Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This example demonstrates how to use the Vector3 and Matrix classes to transform a point.
To transform a point
- Create a Matrix by using CreateRotationY or one of the other Create methods.
- Pass the point and the Matrix to the Vector3.Transform method.
static Vector3 RotatePointOnYAxis( Vector3 point, float angle )
{
// Create a rotation matrix that represents a rotation of angle radians.
Matrix rotationMatrix = Matrix.CreateRotationY( angle );
// Apply the rotation matrix to the point.
Vector3 rotatedPoint = Vector3.Transform( point, rotationMatrix );
return rotatedPoint;
}
See Also
Matrix Creation Methods
CreateRotationX
CreateRotationY
CreateRotationZ
CreateScale
CreateTranslation