Description
Initializes a
Texture
Matrix from texture corner points. Normally, a texture is
mapped such that the lower left corner is texture coordinate (0,
0), the lower right is (1, 0), the upper right is (1, 1), and the
upper left is (0, 1). This code remaps those corners to new
corners. For example, remapping the lower left corner to (0.5, 0),
the lower right to (1, 0.5), the upper right to (0.5, 1), and the
upper left to (0, 0.5) would rotate the texture 45 degress.
Syntax
Parameters
Example
Shows the format of
the Corner0, Corner1, Corner2 and Corner3 parameters when creating
a texture matrix.
[C#] |
Copy Code
|
Array lowerLeftCorner = new object[]
{
-0.386182,
42.938583
};
Array lowerRightCorner = new object[]
{
-0.375100,
42.929871
};
Array upperRightCorner = new object[]
{
-0.333891,
42.944780
};
Array upperLeftCorner = new object[]
{
-0.359980,
42.973438
};
surfaceMesh.TextureMatrix = sceneManager.Initializers.TextureMatrix.InitializeWithRectangles(
ref lowerLeftCorner, ref lowerRightCorner, ref upperRightCorner, ref upperLeftCorner);
|
|
Shows the format of
the Corner0, Corner1, Corner2 and Corner3 parameters when creating
a texture matrix.
[Visual Basic .NET] |
Copy Code
|
Dim lowerLeftCorner As Array =
New Object() {-0.386182, 42.938583}
Dim lowerRightCorner As Array =
New Object() {-0.3751, 42.929871}
Dim upperRightCorner As Array =
New Object() {-0.333891, 42.94478}
Dim upperLeftCorner As Array =
New Object() {-0.35998, 42.973438}
surfaceMesh.TextureMatrix =
sceneManager.Initializers.TextureMatrix.InitializeWithRectangles(lowerLeftCorner,
lowerRightCorner, upperRightCorner, upperLeftCorner)
|
|
See Also