import graphics3d.Graphics3DFramework ; import Graphics3D ; import Math ; // sin関数を使用するため // 座標系のIDを控えておく変数 int coord ; // 時刻カウンタ(画面更新周期単位) int t = 0 ; // プログラムの最初に呼び出される関数 void onStart ( int rendererID ) { // 画面サイズや背景色の設定(省略可能) setWindowSize(800, 600) ; setBackgroundColor(0, 0, 0, 255) ; // ローカル座標系を生成 coord = newCoordinate( ) ; // ローカル座標系をワールド座標系に配置 mountCoordinate( coord, rendererID ) ; // ローカル座標系上に座標軸モデルを配置 int axis1 = newAxisModel( 1.5, 1.5, 1.5 ) ; mountModel( axis1, rendererID, coord ) ; // ワールド座標系上に座標軸モデルを配置 int axis2 = newAxisModel( 3.0, 3.0, 3.0 ) ; mountModel( axis2, rendererID ) ; } // 画面更新周期ごとに毎秒数十回呼び出される関数 void onUpdate (int renderer) { // オイラー角による姿勢制御 setCoordinateAngle( coord, 0.08*t, 0.5*sin(0.03*t), 0.3*t ) ; // 時刻カウンタを加算 t++; }