I'm trying to do exactly what the title of the thread states. I have a plane with black and white vertex colors - think of a height map.
The plane contains 4,225 vertices and 8,192 triangles in it. Basically, it has 64 x 64 segments on length and width.
Depending on the color, that's what gets saved to that specific vertex.
Although, I can manage to get the colors with this code:
obj = $
obj_mesh = obj.mesh
obj_mesh_verts = obj_mesh.numverts
obj_name = "heightmap.bin"
_fileDebug = newScript()
file = fopen obj_name "wb"
for i = 1 to obj_mesh_verts do
vertColor = getVertColor obj_mesh i
format "% \n" (vertColor.r as integer) to:_fileDebug
WriteByte file (vertColor.r)
What I should see in the hex editor is a grid of the same colors - in ASCII.
But, the output I get doesn't even relate to what I see in the plane.
Any ideas on what I can do to save each vertex / byte as the correct color (black and / or white)?
I cannot tell what vertex color is being saved to what vertex.