AGI STK Graphics 11 Send comments on this topic.
SetTextureCoordinates Method (IAgStkGraphicsMarkerBatchPrimitiveOptionalParameters)
See Also  Example
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.





Description

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

Syntax

[Visual Basic .NET]
Public Sub SetTextureCoordinates( _
   ByRef TextureCoordinates As System.Array _
) 

[C#]
public void SetTextureCoordinates(
ref System.Array TextureCoordinates
);

[Managed C++]
public: void SetTextureCoordinates(
System::Array ^^ TextureCoordinates
);

[Java]
public  setTextureCoordinates(
Object[] TextureCoordinates
);

[Unmanaged C++]
public: HRESULT SetTextureCoordinates(
SAFEARRAY ** TextureCoordinates
);

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.

Example

Shows the format of the TextureCoordinates parameter when setting per marker texture coordinates.
[C#] Copy Code
Array coordinates = new object[] 

    0011
    1100 
}; 
 
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] Copy Code
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)

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1