STK Graphics PrimitivesSend comments on this topic.
InitializeWithRectangles Method (IAgStkGraphicsTextureMatrixFactory)
See Also
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.
Windows





Windows & Linux

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( _
    ByVal Corner0 As System.Array, _
    ByVal Corner1 As System.Array, _
    ByVal Corner2 As System.Array, _
    ByVal Corner3 As System.Array _
) As IAgStkGraphicsTextureMatrix
[C#]
public IAgStkGraphicsTextureMatrix InitializeWithRectangles(
    System.Array Corner0,
    System.Array Corner1,
    System.Array Corner2,
    System.Array Corner3
);
[Managed C++]
public: IAgStkGraphicsTextureMatrix^ InitializeWithRectangles(
    System::Array ^ Corner0,
    System::Array ^ Corner1,
    System::Array ^ Corner2,
    System::Array ^ Corner3
);
[Unmanaged C++]
public: HRESULT InitializeWithRectangles(
    SAFEARRAY * * Corner0,
    SAFEARRAY * * Corner1,
    SAFEARRAY * * Corner2,
    SAFEARRAY * * Corner3,
    IAgStkGraphicsTextureMatrix ** ppRetVal
);
[Java]
public IAgStkGraphicsTextureMatrix initializeWithRectangles(
    AgSafeArray Corner0,
    AgSafeArray Corner1,
    AgSafeArray Corner2,
    AgSafeArray Corner3
);
[Python - STK API ]
def InitializeWithRectangles(self, Corner0:list, Corner1:list, Corner2:list, Corner3:list) -> "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.

See Also

Example

Shows the format of the Corner0, Corner1, Corner2 and Corner3 parameters when creating a texture matrix.
[C#]
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]
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)
© 2024 Analytical Graphics, Inc. All Rights Reserved.