I’m in the process of making a 3D anatomy application for a biology class. I’m having trouble making a method/script that allows the user to rotate an object on screen and select different parts of the anatomy. Is there a tutorial or just a point in the right direction someone could give me?
Thanks.
A typical interface for this sort of thing is the ‘arcball’ interface. You should be able to find info on this online (for manipulating the object’s orientation, you can use the Transform.rotation field, which is a quaternion). I don’t know for sure whether that would meet your needs, but it’s the first thing that comes to mind. (There are quite a few useful scripts shipped with Unity and located on the wiki, so you may be able to find an existing script that implements this or something like it.)
For selecting different parts of the body, Physics.Raycast() might be a good choice. You could create colliders corresponding to the parts that you want to be selectable. Or, if you need more accuracy, you might be able to make the entire object a (non-convex) mesh collider, and then determine which part was selected based on the returned ‘triangleIndex’ field of the RaycastHit struct. (For this to work, you’d need to store meta-data specifying which triangles corresponded to which parts.)