' This example illustrates how to enumerate the triangles
' of a polygon mesh and print out the RGBA values at each
' triangle vertex
set oRoot = Application.ActiveProject.ActiveScene.root
set oCube = oRoot.AddGeometry( "Cube", "MeshSurface" )
CreateVertexColorSupport ,, oCube
set oGeometry = oCube.activeprimitive.geometry
set oTriangles = oGeometry.Triangles
for each oTriangle in oTriangles
logmessage oTriangle.Name
for each oVertex in oTriangle.Points
set oColor = oVertex.Color
logmessage vbTab & "RGBA(" & _
oColor.red & "," & _
oColor.green & "," & _
oColor.blue & "," & _
oColor.alpha & ")"
next
next
|