MaxScript IntersectRay can not work on poly,max.net can do this ?

 
 
 
Posted by:SITT
Data created:26 May 2010

@_@

i want to do

MouseRay = MapScreenToWorldRay Mouse.Pos
ThePoly = thePolyObject
intersectRayEx ThePoly MouseRay

get the intersect Position point and face index

How about:

ITriObject triObj = (ITriObject)myNode.EvalWorldState( 0, true ).Obj.ConvertToType( 0, TriObjClassID );
IMesh mesh = triObj.Mesh;

int faceIndex = mesh.IntersectRay( myRay, rayPoisition, normal );

Marsel Khadiyev (Software Developer, EPHERE Inc.)