View Full Version : Raytrace Function From Mpxcommand?

02 February 2008, 01:11 PM
I would like to use this function

MStatus MRenderUtil:: raytraceFirstGeometryIntersections ( const MFloatVectorArray & rayOrigins, const MFloatVectorArray & rayDirections, const long objectId, const long raySampler, MFloatVectorArray & resultIntersections, MIntArray & resultIntersected )

from my MPxCommand that I have written.

Where do I get values for objectId and raySampler? The documentation says to make an input to my node with those names, but I am not in a node!!



02 February 2008, 04:02 PM
you can use the intersection-functions in the fnMesh class. this works only on a specific mesh and not on all. but i'm not sure if you can use the renderutlis' tracing without being rendering.

02 February 2008, 12:58 PM
If you don't want to use that function, the basic MFnMesh (MFnNurbsSurface too) have their own functions, that are allowing you to calculate intersections, just access the node/nodes though either the selection list, or the parameters given to the command.

CGTalk Moderation
02 February 2008, 12:58 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.