> Haven't tested it with meshes but I don't expect it would work in all
> as it requires the use of an inside(obj,vect) test. I think the POV docs
> state that meshes can have an inside if they form a closed shape and you
> specify the inside_vector, but I rarely use meshes where I can get away
> with SDL, CSG or macros so haven't tried it out.
Just a note for those interested in using this on meshes:
If you've got a well-defined mesh, with which I mean it has no coincident
surfaces and no holes (which is also known as waterproof), you'd just need a
macro which'll shoot a ray in some random direction. When it hits a surface
of the mesh, continue from there and count how many times you hit a surface
on a mesh whilst travelling along the ray to the outside of the mesh. If the
resulting number is uneven, the original starting point is inside the mesh,
otherwise it's outside.
This even works for multiple mesh objects that intersect, but like I said,
no coincident surfaces and the meshes all have to be completely closed for
the counting to work properly.
I've done this for various things, especially my Liquid Surface Simulation
Macros to get the water to properly interact with meshes.
aka "Tim Nikias v2.0"
Post a reply to this message