|
|
|
|
Translation and Scaling |
The following transformation translates the point (x, y, z) to a new point (x', y', z').
You can manually create a translation matrix in managed code. The following C# code example shows the source code for a function that creates a matrix to translate vertices.
[C#]
private Matrix TranslateMatrix(float dx, float dy, float dz)
{
Matrix ret;
ret = Matrix.Identity;
ret.M41 = dx;
ret.M42 = dy;
ret.M43 = dz;
return ret;
}
For convenience, managed the Microsoft Direct3D supplies the Translation method.
The following transformation scales the point (x, y, z) by arbitrary values in the x-, y-, and z-directions to a new point (x', y', z').
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center