AGI STK Graphics 11 Send comments on this topic.
SetPerVertexColors Method (IAgStkGraphicsTriangleMeshPrimitiveOptionalParameters)
See Also  Example
Colors
An array containing the numeric representation of colors for each vertex in the mesh. There must be one color for each position passed to the Triangle Mesh Primitive's Set method. In .NET a Color should be translated to a number by calling its ToArgb method and casting the result as an unsigned integer.





Description

Defines a collection of colors.

Syntax

[Visual Basic .NET]
Public Sub SetPerVertexColors( _
   ByRef Colors As System.Array _
) 

[C#]
public void SetPerVertexColors(
ref System.Array Colors
);

[Managed C++]
public: void SetPerVertexColors(
System::Array ^^ Colors
);

[Java]
public  setPerVertexColors(
Object[] Colors
);

[Unmanaged C++]
public: HRESULT SetPerVertexColors(
SAFEARRAY ** Colors
);

Parameters

Colors
An array containing the numeric representation of colors for each vertex in the mesh. There must be one color for each position passed to the Triangle Mesh Primitive's Set method. In .NET a Color should be translated to a number by calling its ToArgb method and casting the result as an unsigned integer.

Example

Shows the format of the Colors parameter when setting per vertex colors.
[C#] Copy Code
Array colors = new object[] 

    Color.Red.ToArgb(), 
    Color.Green.ToArgb(), 
    Color.Blue.ToArgb(), 
    Color.White.ToArgb() 
}; 
 
IAgStkGraphicsTriangleMeshPrimitiveOptionalParameters parameters = sceneManager.Initializers.TriangleMeshPrimitiveOptionalParameters.Initialize(); 
parameters.SetPerVertexColors(ref colors); 
 

Shows the format of the Colors parameter when setting per vertex colors.
[Visual Basic .NET] Copy Code
Dim colors As Array = New Object() {Color.Red.ToArgb(), Color.Green.ToArgb(), Color.Blue.ToArgb(), Color.White.ToArgb()}

Dim parameters As IAgStkGraphicsTriangleMeshPrimitiveOptionalParameters = sceneManager.Initializers.TriangleMeshPrimitiveOptionalParameters.Initialize()
parameters.SetPerVertexColors(colors)

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1