AGI STK Graphics 11 Send comments on this topic.
InitializeWithRectangles Method (IAgStkGraphicsTextureMatrixFactory)
See Also  Example
Corner0
An array containing the new location of the texture's lower left corner in the order x, y.
Corner1
An array containing the new location of the texture's lower right corner in the order x, y.
Corner2
An array containing the new location of the texture's upper right corner in the order x, y.
Corner3
An array containing the new location of the texture's upper left corner in the order x, y.

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

[Visual Basic .NET]
Public Function InitializeWithRectangles( _
   ByRef Corner0() As Variant, _
   ByRef Corner1() As Variant, _
   ByRef Corner2() As Variant, _
   ByRef Corner3() As Variant _
) As IAgStkGraphicsTextureMatrix

Parameters

Corner0
An array containing the new location of the texture's lower left corner in the order x, y.
Corner1
An array containing the new location of the texture's lower right corner in the order x, y.
Corner2
An array containing the new location of the texture's upper right corner in the order x, y.
Corner3
An array containing the new location of the texture's upper left corner in the order x, y.

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

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK 11.1 Programming Interface