import graphics3d.Graphics3DFramework; import Graphics3D; import Math; // For using the sin function // Variable to hold the coordinate system ID int coord; // Time counter (in update cycles) int t = 0; // Function called at the start of the program void onStart ( int rendererID ) { // Optional screen size and background color settings setWindowSize( 800, 600 ); setBackgroundColor( 0, 0, 0, 255 ); // Create a local coordinate system coord = newCoordinate( ); // Mount it on the world coordinate system mountCoordinate( coord, rendererID ); // Place a small axis model on the local coordinate system int axis1 = newAxisModel( 1.5, 1.5, 1.5 ); mountModel( axis1, rendererID, coord ); // Place a large axis model on the world coordinate system int axis2 = newAxisModel( 3.0, 3.0, 3.0 ); mountModel( axis2, rendererID ); } // Function called several times per second to update the display void onUpdate ( int rendererID ) { // Move along a Lissajous curve and increment time setCoordinateLocation( coord, sin(0.1*t), sin(0.5*t), 0.0 ); t++; }