- Home /
Is there a way to get world coordinates from mesh vertices?
I need to convert some vertices in a Mesh to their current world coordinates. The mesh may be nested in several transforms. Is there a simple way to do this?
Answer by DaveA · Dec 10, 2010 at 07:05 AM
I'm guessing it has to do with Transform.TransformPoint()
Probably the other way round. Transform.InverseTransformPoint().
If he's looking for world coordinates, it's probably TransformPoint() that he's looking for, not InverseTransformPoint().
Answer by LegionLover · Nov 03, 2011 at 09:56 PM
I'm looking at this too and I think TransformPoint wouldn't work because that only changes the transform (the center of the object/mesh) from local space to world space, so that's only one point for the whole object. I think what DaveA is asking (and what I'm trying to figure out too) is how to determine the world space co-ordinates for EACH individual vertex point on a mesh. Is there a way to do that?
You would iterate over every vertex in the mesh's vertex list, calling TransformPoint for each one. I'm assu$$anonymous$$g that a vertex at 0,0,0 would coincide with the object's origin.
Yeah that's basically how you do it. I think that's how my mesh batcher worked? I'd have to check it, it was a while back.
Your answer

Follow this Question
Related Questions
How to obtain the world space coordinates for each individual vertex on a Mesh? 1 Answer
Connecting flatshaded vertices 0 Answers
how to remove vertices of a certain colour range from a mesh? 0 Answers
64k vertices limitation 2 Answers
Shuriken world collision not working with mesh collider 1 Answer