Matrix.RotationY(Single)
RotationY メソッド
使用例
- y 軸を中心とした一定速度でのオブジェクトの回転
y 軸を回転軸にして回転する行列を作成する。
定義
Visual Basic | Public Shared Function RotationY( _ ByVal angle As Single _ ) As Matrix |
C# | public static Matrix RotationY( float angle ); |
Managed C++ | public: static Matrix RotationY( float angle ); |
JScript | public static function RotationY( angle : float ) : Matrix; |
パラメータ
angle | System.Single. |
戻り値
Microsoft.DirectX.Matrix.
使用例
y 軸を中心とした一定速度でのオブジェクトの回転
この例では、y 軸を中心に一定の速度でポリゴン モデルを回転させる方法を示す。
回転行列トランスフォームを使って、回転角度を規則的に変化させる。この場合、回転行列 Matrix.RotationY への回転の入力角度 (ラジアン単位) を簡単な式で更新する。この式では、Environment.TickCount プロパティが返す、経過したミリ秒数を使う。次に、Device.Transform.World プロパティを回転行列で更新する。
using Microsoft.DirectX.Direct3D;
Device device = null; // Create rendering device
// For the world matrix, rotate the object about the y-axis.
device.Transform.World = Microsoft.DirectX.Matrix.RotationY(
System.Environment.TickCount / 150.0f );
対象
© 2002 Microsoft Corporation. All rights reserved. Terms of use.