' This example demonstrates how Cluster indices are mapped to indices of the points
' on the Geometry via the Cluster.Elements property
NewScene ,false
set oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface" )
' Create a cluster that only contains some of the points.
set oCluster = oSphere.ActivePrimitive.Geometry.AddCluster( _
siVertexCluster, "MyFrontPoints", Array( 5,10,12 ) )
set oClusterElements = oCluster.Elements
aElements = oClusterElements.Array
for iElement=lbound(aElements,1) to ubound(aElements,1)
logmessage "Cluster item " & iElement & _
" refers to point " & aElements(iElement) & " on the Geometry"
next
'Output of this script is:
'INFO : "Cluster item 0 refers to point 5 on the Geometry"
'INFO : "Cluster item 1 refers to point 10 on the Geometry"
'INFO : "Cluster item 2 refers to point 12 on the Geometry"// |