Jump to content
  • Advertisement
Sign in to follow this  

3D studio Max, vertex colors

This topic is 5414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I read the vertex colors from a 3D studio Max export file .3ds ? In the model, the vertices are colored by using the vertex paint plug-in in Max 6.0, that is, I’ve added colors to each vertex as a material. I can read face colors from chunk 0x4130, no problem, but how do I read the vertex colors ? Any advice is appreciated ..

Share this post

Link to post
Share on other sites
try this for face j vertex k, where k=0, 1, or 2:

Mesh *mesh; // 3ds Max mesh
if (mesh->numCVerts > 0)
long index = mesh->vcFace[j].t[k];
long vertexColor = (((long)(mesh->vertCol[index].x * 255) << 16) + ((long)(mesh->vertCol[index].y * 255) << 8)
+ ((long)(mesh->vertCol[index].z * 255))) | 0xff000000;

In Max, setting a single vertex color generates a new array of verts (one for each geo vert) holding the color for each vert.

image space

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!