- Home /
Get number of specific vertex on model
hi all,
I have a model and want to find out - say, the number of the vertex on top of the right thumb. I noticed that vertex numbers in C4D and Unity are not the same, so checking in the 3D editor is not an option.
I wrote a script with bake.mesh(), which allows me to manually loop through the vertice array of the model and transform a cube with those coordinates. But this is tedious, since it takes a long time to find the vertice I want.
I need those vertice numbers to get their coordinates out of the bake.mesh() array.
Is there a faster way to do this? Thanks :)
If the gameobject has a collider, you can use RaycastHit.triangleIndex to get the triangle and it's three vertices, then loop through these three vertices to check which one is the nearest to the position you are after (like, your cursor in world space). Cumbersome, but it works.
If it has a rig, you could just iterate all vertices and check the distance to the thumb bone.
Your answer
Follow this Question
Related Questions
Find world position of a vertice on a skinned mesh renderer 1 Answer
SkinnedMeshRenderer.BakeMesh() is baking ragdoll instead of animation 0 Answers
why is Unity got more vertices than 3dsmax 1 Answer
Small Vert/Tris count still generating more draw calls than expected 1 Answer
How to add vertices to a cube 1 Answer