该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


scene = Scene Box( 300, 300 ); // make a scene box
New Window( "Cylinder", scene ); // put the scene in a window
For( i = 1, i < 360, i++,
scene << Perspective( 50, 1, 10 );
scene << Translate( 0.0, 0.0, -2 );
// move the world so 0,0,0 is visible in the camera
scene << Enable( Lighting );
scene << Enable( Light0 );
scene << Enable( Light1 );
scene << Light( Light0, POSITION, 1, 1, 1, 1 ); // near viewer
scene << Light( Light0, DIFFUSE, 1, 0, 0, 1 ); // red light
scene << Light( Light1, POSITION, -1, -1, -1, 1 ); // behind object
scene << Light( Light1, DIFFUSE, .5, .5, 1, 1 ); // blue-gray light
scene << Enable( Fog );
scene << Enable( NORMALIZE );
scene << Rotate( i, 1, 0, 0 );
scene << Rotate( i * 3, 0, 1, 0 );
scene << Rotate( i * 3 / 2, 0, 0, 1 );
scene << Cylinder( 0.5, 0.5, 0.5, 40, 10 );
scene << Update;
Wait( 0.01 );
图 13.18 Fog