PDA

View Full Version : MeshProjIntersect in SDK?


ivanisavich
04-16-2012, 07:45 PM
Is there an implementation of the MXS MeshProjIntersect function in the SDK? I can't find anything other than the intersectRay methods, which are too slow for what I need.

hblan
04-18-2012, 02:09 PM
I dont know how to code in SDK , but I think it is a Math thing , some suggestion , wish can help u :
1. it is a ray , and we can make a matrix coordinated system with the ray , as i know , in max script , a command : matrixFromNormal . let the ray as the Z axis . in C++ , maybe it is not hard to make a same coord system in C++ .

2. get the faces of the mesh , filter faces with (dot face_normal ray_Z_axis ) < 0 . that will remove the reversed faces .

3. get face verts , 3 verts of a mash tri face. convert them into Ray coord system .

4. if all 3 verts Z in new coord system < 0 . filter them .

5. if the ray hit the mesh face , ( we only consider in XY axis , it is a plane 4 quardrants .) the 3 verts must be distribute in 3 different quadrants .

Klunk
04-19-2012, 07:58 AM
you could check out the IProjection... interfaces in the SDK, may be something there you can use.

ivanisavich
04-20-2012, 07:02 PM
you could check out the IProjection... interfaces in the SDK, may be something there you can use.

This seems to be what I was looking for...thank you!

CGTalk Moderation
04-20-2012, 07:02 PM
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.