PDA

View Full Version : help finding ws coordinace on surface


JayWalker
10-02-2009, 04:33 AM
im going to be making a procedural animation script to drive the animation of a spider leg. i need to be able to see if a point passes though the face of a surface. and where that intersection is. the surface will be most likely a polygon. something like the image below (mock up). im going to be using both python and mel.
http://i3.photobucket.com/albums/y66/Maya3d_vex/leg.jpg

isoparmB
10-02-2009, 05:25 AM
If this were setup with nodes it would most likely involve closestPointOnMesh nodes with some condition nodes and sampler info (to get normal information relative from the leg's point of view. If your point is on a flipped normal side of the mesh, the setup has collided and your leg is returned to the closest point on mesh point), but a setup like that would be limited to a specified mesh surface as an input. You'd have to predetermine the name of the mesh you want your spider leg to collide against to connect it to the CPOM.

Or, if you wanted the setup to consider all meshes in your scene, you could have an expression which is tied in with a CPOM node that connects to all meshes in the scene, one at a time, gets the closest point for each relative from the leg, and narrrows down the list to the mesh with the nearest point to determine the current collision object.

CGTalk Moderation
10-02-2009, 05:25 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.