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 System.Array, _
   ByRef Corner1 As System.Array, _
   ByRef Corner2 As System.Array, _
   ByRef Corner3 As System.Array _
) As IAgStkGraphicsTextureMatrix

[C#]
public IAgStkGraphicsTextureMatrix InitializeWithRectangles(
ref System.Array Corner0,
ref System.Array Corner1,
ref System.Array Corner2,
ref System.Array Corner3
);

[Managed C++]
public: IAgStkGraphicsTextureMatrix^ InitializeWithRectangles(
System::Array ^^ Corner0,
System::Array ^^ Corner1,
System::Array ^^ Corner2,
System::Array ^^ Corner3
);

[Java]
public IAgStkGraphicsTextureMatrix initializeWithRectangles(
Object[] Corner0,
Object[] Corner1,
Object[] Corner2,
Object[] Corner3
);

[Unmanaged C++]
public: HRESULT InitializeWithRectangles(
SAFEARRAY ** Corner0,
SAFEARRAY ** Corner1,
SAFEARRAY ** Corner2,
SAFEARRAY ** Corner3,
IAgStkGraphicsTextureMatrix ** ReturnValue
);

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 All Rights Reserved.

STK Programming Interface 11.0.1