|
I'm wondering if there is a more direct way to select a single polygon/face at runtime other than (touch, highlight poly): 1) raycast mouse to poly 2) search positions to find which set of vertices that's closest to 3) convert vertices to nearest face 4) "highlight" the poly/face to show that it's been selected
(comments are locked)
|
|
If you use a mesh collider, then you have access to RaycastHit.triangleIndex. Highlighting the selected face could still have some difficulty, though. Unless you're sure that every single vertex in the mesh is split, it would probably be easier to construct a new mesh that consists of a single face, and position it in the same spot as the selected face. Okay, so position the new mesh according to
Dec 22 '10 at 06:14 AM
ina
See the example in the docs for RaycastHit.triangleIndex
Dec 22 '10 at 06:46 AM
Eric5h5
why is this mesh only? why doesn't this work for default cubes in unity?
Apr 30 '12 at 11:35 PM
ina
Also is there a way to check if surrounding triangles are parallel to the currently hit triangle?
May 01 '12 at 02:36 AM
ina
Hmm, so I've been puzzling over this for quite some time... How do you construct the new mesh that consists of the single face? (How do you know which triangles this is?)
May 01 '12 at 06:17 AM
ina
(comments are locked)
|
