STK Graphics PrimitivesSend comments on this topic.
SetTextureCoordinates Method (IAgStkGraphicsMarkerBatchPrimitiveOptionalParameters)
See Also
TextureCoordinates
An array containing the texture coordinates (in the order s, t, p, q) for each marker in the batch. There must be one s texture coordinate, followed by one t texture coordinate, followed by one p texture coordinate, followed by one q texture coordinate for each position passed to the Marker Batch Primitive's Set or SetPartial method.
Windows





Windows & Linux

Description

Defines a collection of texture coordinates, one for each marker in the batch.

Syntax

[Visual Basic .NET]
Public Sub SetTextureCoordinates( _
    ByVal TextureCoordinates As System.Array _
)
[C#]
public void SetTextureCoordinates(
    System.Array TextureCoordinates
);
[Managed C++]
public: void SetTextureCoordinates(
    System::Array ^ TextureCoordinates
);
[Unmanaged C++]
public: HRESULT SetTextureCoordinates(
    SAFEARRAY * * TextureCoordinates
);
[Java]
public void setTextureCoordinates(
    AgSafeArray TextureCoordinates
);
[Python - STK API ]
def SetTextureCoordinates(self, TextureCoordinates:list) -> None:

Parameters

TextureCoordinates
An array containing the texture coordinates (in the order s, t, p, q) for each marker in the batch. There must be one s texture coordinate, followed by one t texture coordinate, followed by one p texture coordinate, followed by one q texture coordinate for each position passed to the Marker Batch Primitive's Set or SetPartial method.

Remarks

Each texture coordinate component is in the range [0, 1]. The s and t components define the bottom left corner and the p and q components define the upper right corner. When a marker uses an entire texture, the texture coordinates are [s, t, p, q] = [0, 0, 1, 1].

Per-marker texture coordinates are used to implement a technique called a texture atlas. Instead of creating several small textures and assigning each texture to markers using per-marker textures, one large texture containing all the images is made. This texture is assigned to the marker batch and each marker is given texture coordinates that index the correct part of the texture. This can lead to better performance due to the reduced number of costly texture changes during rendering.

Per-marker texture coordinates override the per-batch texture coordinate. Therefore, when per-marker texture coordinates are defined with this method, the marker batch's MarkerBatchPrimitive.TextureCoordinate property is ignored.

See Also

Example

Shows the format of the TextureCoordinates parameter when setting per marker texture coordinates.
[C#]
Array coordinates = new object[]
{
    0, 0, 1, 1,
    1, 1, 0, 0
};

IAgStkGraphicsMarkerBatchPrimitiveOptionalParameters parameters = sceneManager.Initializers.MarkerBatchPrimitiveOptionalParameters.Initialize();
parameters.SetTextureCoordinates(ref coordinates);
Shows the format of the TextureCoordinates parameter when setting per marker texture coordinates.
[Visual Basic .NET]
Dim coordinates As Array = New Object() {0, 0, 1, 1, 1, 1, _
	0, 0}

Dim parameters As IAgStkGraphicsMarkerBatchPrimitiveOptionalParameters = sceneManager.Initializers.MarkerBatchPrimitiveOptionalParameters.Initialize()
parameters.SetTextureCoordinates(coordinates)
© 2024 Analytical Graphics, Inc. All Rights Reserved.