POV-Ray : Newsgroups : povray.binaries.images : Funky Granules : Re: Funky Granules Server Time: 23 May 2018 01:25:33 GMT
  Re: Funky Granules  
From: Tim Nikias
Date: 15 Apr 2006 11:46:15
> Haven't tested it with meshes but I don't expect it would work in all
cases
> 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.

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.