Matrix.Transform(Vector3,Quaternion,Vector3,Vector3,Quaternion,Vector3)
Transform メソッド
使用例
- y 軸を中心とした一定速度でのオブジェクトの回転
トランスフォーム行列を作成する。
定義
Visual Basic | Public Sub Transform( _ ByVal scalingCenter As Vector3, _ ByVal scalingRotation As Quaternion, _ ByVal scalingFactor As Vector3, _ ByVal rotationCenter As Vector3, _ ByVal rotation As Quaternion, _ ByVal translation As Vector3 _ ) |
C# | public void Transform( Vector3 scalingCenter, Quaternion scalingRotation, Vector3 scalingFactor, Vector3 rotationCenter, Quaternion rotation, Vector3 translation ); |
Managed C++ | public: void Transform( Vector3 scalingCenter, Quaternion scalingRotation, Vector3 scalingFactor, Vector3 rotationCenter, Quaternion rotation, Vector3 translation ); |
JScript | public function Transform( scalingCenter : Vector3, scalingRotation : Quaternion, scalingFactor : Vector3, rotationCenter : Vector3, rotation : Quaternion, translation : Vector3 ) : void; |
パラメータ
scalingCenter | Microsoft.DirectX.Vector3. |
scalingRotation | Microsoft.DirectX.Quaternion. |
scalingFactor | Microsoft.DirectX.Vector3. |
rotationCenter | Microsoft.DirectX.Vector3. |
rotation | Microsoft.DirectX.Quaternion. |
translation | Microsoft.DirectX.Vector3. |
使用例
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.