Vertex Color Information
Vertex color information is stored with a Mesh. This information can be used in conjunction with the vertex color map ( \MAXSDK\SAMPLES\MATERIALS\VERTCOL.CPP ) or the Color Per Vertex utility and modifier ( \MAXSDK\SAMPLES\UTILITIES\APPLYVC\APPLYVC.CPP and AVCMOD.CPP ).
Several public member fields and methods in the Mesh class provide access to this data.
Data Members
Mesh::numCVerts- The number of color vertices.Mesh::vertCol- Array of color vertices. Note thatVertColoris aPoint3typedef.Mesh::vcFace- Array of vertex color faces.Mesh::vertColArray- The source data for vertex colors can come from other than the internal vertex color array (Mesh::vertCol). The data can come from an external array or one of the map channels. When 3ds Max is rendering, the color values come from theMesh::vertColArrayvariable. This array defaults to the internal array (Mesh::vertCol) but can be set to an external array or a mapping channel.Mesh::curVCArray- If an external array is used this data member points to it (it defaults to NULL).Mesh::curVCChan- If a mapping channel is used this data member indicates which one. It defaults to 0.Mesh::vcFaceData- When 3ds Max is rendering the vertex lookup comes from this variable. The defaults is to use theMesh::vcFacedata. However if a mapping channel is used for color lookup then 3ds Max uses itsTVFacestructure.
Methods
The methods associates with this are as follows:
Mesh::setNumVertCol()- Sets the number of vertex colors.Mesh::getNumVertCol()- Gets the number of vertex colors.Mesh::setNumVCFaces()- Sets the number of vertex color faces.Mesh::setCVertArray()- Is used to set a different source array for vertex color data. This can be either an external array or one of the mapping channels.
