import graphics3d.Graphics3DFramework ; import Graphics3D ; import Math ; // 円周率(PI)の値を使用するため // プログラムの最初に呼び出される関数 void onStart ( int rendererID ) { // ローカル座標系を生成 int coord = newCoordinate( ) ; // ローカル座標系をワールド座標系に配置 mountCoordinate( coord, rendererID ) ; // ローカル座標系をZ軸まわりに45度回転 rotCoordinateZ( coord, PI/4.0 ) ; // X=1.0のベクトルを生成 int vector = newVector( 1.0, 0.0, 0.0 ) ; // ローカル座標系上にベクトルを配置 mountVector( vector, rendererID, coord ) ; // 座標変換結果の控え用に、vectorのコピーを生成 int trans = newVector( vector ) ; // vectorをワールド座標系へ座標変換し、結果をtransに代入 transformVector( vector, trans, getWorldCoordinate( rendererID ) ) ; // 座標変換結果を出力 println( getVectorX( trans ), getVectorY( trans ), getVectorZ( trans ) ) ; }