View Full Version : reading the vertex color of a texture on a mesh

11 November 2010, 05:36 PM

I am trying to write a script that convert mesh objects into voxels. what i have now is that at every vertex a box is placed. The mesh has a texturemap and where a box is placed i want it to inherit the color of the texturemap on that vertex on the mesh.

What i can do so far is read a bitmap image and read the pixels of this bitmap and i can also read the color vertex on a mesh when you paint on it. I do this with with this small script
theMesh = $GeoSphere001
count = theMesh.numverts

for i = 1 to count do
color1 = getVertColor theMesh i
print color1

However i am not succesfull in putting these two things together. I have been reading the help file and if i am correct i should put a unwrap modifier on the mesh, so i can read the uvw coords. I can do that with the getTVert, but what then, how do i connect those values with the bitmap pixel location?

Perhaps i am going the wrong way there is an easier way?



11 November 2010, 05:40 PM
at least three threads on this forum this year were about this subject. Try to search.

CGTalk Moderation
11 November 2010, 05:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.