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 rendererID ) { // 原点位置指定でリサージュ曲線移動し、時刻カウンタを加算 setCoordinateLocation( coord, sin(0.1*t), sin(0.5*t), 0.0 ); t++; }