Notifications
Clear all

[Closed] color(diffuse) value at vertex location?

You have to use barycentric coordinates because each surface vertice can have up to N or N-1 (in the case of vertices on an open edge), where N is the number of edges connecting to the vertice. Which means you can have multiple texture vertices for each surface vertice, but only one face per texture face. So you have to use barycentric coordinates otherwise you will get different results if the texture edges are broken. I strongly suggest you read “Understanding Texture Coordinates and Vertex Colors” in the maxscript help. If you aren’t willing to listen, then you won’t find a solution.

The only other solution would be to use Grant Adam’s MapToVColor and use that to query the vertex color.

-Eric

PiXeL_MoNKeY: I am listening and I’m aware of the differences between object mesh and texture mesh.

We seem to desagree on the meaning of ‘barycentric coordinates’ (which I also use regularly).
Say you have a face defined by verts A, B and C. You use vectors B-A and C-A as a coordinate system local to the face. The multipliers x and y you apply to those vectors to define a specific point on the face ARE the barycentric coordinates (with x and y between 0 and 1 and their sum no greater than 1).

While going from object vert to texture vert (for a specific face) is a completely different matter. You find if the object vert is the 1st, 2nd or 3rd on that face and grab the UV coordinates of the same vert on the texture face. Same thing the other way around.
As I said, I need the color where the vertices are, not somewhere else on the faces.

Anyway, my problem is solved now.

If you found a different solution, then it would be nice to post here to prevent a similar topic coming up again.

-Eric

@PiXeL_MoNKeY: I don’t do anything different. My code is pretty similar to plastic’s (see the link in his post).
Don’t get me wrong. I appreciate that you’re trying to help. I really do. I just don’t get your insistance for using barycentric coordinates when I don’t need to.
But thanks anyway.

I misunderstood your needs I guess.

No problem, good to know that the current solution should be a good solution for others in the future.

-Eric

Page 2 / 2