import graphics3d.Graphics3DFramework; import Graphics3D; import Math; // for using sin function // Variable to store the ID of the coordinate system int coord; // Time counter (in frame update units) int t = 0; // Function called at the start of the program void onStart ( int rendererID ) { // Optional: set window size and background color setWindowSize( 800, 600 ); setBackgroundColor( 0, 0, 0, 255 ); // Create a local coordinate system coord = newCoordinate( ); // Mount it onto the world coordinate system mountCoordinate( coord, rendererID ); // Attach a small axis model to the local coordinate system int axis1 = newAxisModel( 1.5, 1.5, 1.5 ); mountModel( axis1, rendererID, coord ); // Attach a large axis model to the world coordinate system int axis2 = newAxisModel( 3.0, 3.0, 3.0 ); mountModel( axis2, rendererID ); } //Function called multiple times per second to update the screen void onUpdate (int renderer) { // Control orientation using Euler angles setCoordinateAngle( coord, 0.08*t, 0.5*sin(0.03*t), 0.3*t ); // Advance time counter t++; }