- Home /
Converting Mesh to Set of Discrete Coordinates
How would you convert certain discrete regions on the surface of a mesh to world coordinates?
Answer by TowerOfBricks · Dec 17, 2010 at 06:59 AM
Not really sure what you mean by "discrete regions", but here's how you convert vertice data from local positions to world positions
You would do something like this:
(Pseudo code)
vertices = meshFilter.mesh.vertices;
for (i; loop in vertices) { vertices[i] = transform.TransformPoint (vertices[i]); }
//Ta Daa! You've got world coordinates
Of course there are slightly faster ways to do this, like using Transform.LocalToWorldMatrix but this is by far the easiest way.
Your answer
Follow this Question
Related Questions
How to successfully transform local mesh vertex coordinates into world coordinates? 1 Answer
Using compute shader, how to take every vertex of a mesh and make a cube spawn and move to each one? 0 Answers
How do I check if the mouse is over a VISIBLE vertex? 1 Answer
Colors do not work with a mesh created in script? 3 Answers
Mesh.vertices are all 0? 1 Answer