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





Windows & Linux

Description

Defines a collection of colors.

Syntax

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

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.

See Also

Example

Shows the format of the Colors parameter when setting per vertex colors.
[C#]
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]
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)
© 2024 Analytical Graphics, Inc. All Rights Reserved.