import graphics3d.Graphics3DFramework; import Graphics3D; import Math; // for using the constant PI // Function called at the start of the program void onStart ( int rendererID ) { // Create a local coordinate system int coord = newCoordinate( ); // Mount it onto the world coordinate system mountCoordinate( coord, rendererID ); // Rotate the local coordinate system 45 degrees around the Z axis rotCoordinateZ( coord, PI/4.0 ); // Create a vector with X = 1.0 int vector = newVector( 1.0, 0.0, 0.0 ); // Place the vector on the local coordinate system mountVector( vector, rendererID, coord ); // Create a copy of the vector to store the transformation result int trans = newVector( vector ); // Transform the vector into the world coordinate system transformVector( vector, trans, getWorldCoordinate( rendererID ) ); // Output the result println( getVectorX( trans ), getVectorY( trans ), getVectorZ( trans ) ); }