[Closed] intersectRayEx canot use to editpoly?
Hi,
Correct, your object must evaluate to a mesh. If you see the example in the help you will see that it adds a normal modifier that serves two purposes, one to flip the normals and two to evaluate the primitive object to a mesh.
You could hold a snapshot of the mesh using snapshotasmesh in a variable and test that.
Also, does RayMeshGridIntersect do what you want? (still needs a mesh but is cleverer and faster)
Josh.
Another solution is to apply a TurnToMesh modifier to your mesh, then it will work.
Cheers.
Also j-man…
I don’t have very clear how to use RayMeshGridIntersect.
Can you post a quick example doing a comparison between RayMeshGridIntersect and intersectRayEx?
Thanks and cheers!
Allthough I use RayMeshGridIntersect, I never understand what it really does in comparison to intersectRayEx…
Hi,
By far the best example available is the one in the MXSHelp. Execute this script to see how it works. Make sure you have your viewport set to wireframe. This script will show you everything you need to know.
AFAIK RayMeshGridIntersect uses a voxelation grid to speed up the process. It also offers more features. It may be worth searching I think someone hs done speed comparissons before.
J.
Well, aside from speed improvements which are of an order of magnitude greater, it’s also a lot more memory friendly when dealing with very large meshes.
I have no benchmark as such, but i did/do use it in production, and it is the way to go.
As a side note, i’d recommend the oldish, and still unbeaten, Bobo’s dvd on advanced maxscript: the matrix explained.
Buy it and watch it through, and the MXS raytracing routines will hold no secrets anymore.