POV-Ray : Newsgroups : povray.binaries.images : tractor 2008 (164k jpg) : Re: tractor 2008 (164k jpg) Server Time
30 Jul 2024 20:28:11 EDT (-0400)
  Re: tractor 2008 (164k jpg)  
From: Kirk Andrews
Date: 7 Dec 2008 13:00:00
Message: <web.493c0ef762d2e221198b63d90@news.povray.org>
"Edouard Poor" <pov### [at] edouardinfo> wrote:
> stbenge <THI### [at] hotmailcom> wrote:
> >
> > The biggest reason I didn't model this as a mesh is because it's
> > currently impossible to use any proximity patterns with meshes. That's
> > right, impossible! Actually, if somebody can figure out how to get a
> > proximity pattern working with meshes, I would really appreciate it :)
>
> Just write your own inside() function. I gave it a go with the following, and it
> seems to work pretty well. It should really be improved with the equivalent of
> an inside_vector, so you can usefully use it with open meshes, but it's OK for
> a quick attempt.
>
> #macro inside_m( obj, pos )
>  #local current = pos;
>  #local dir = x;
>  #local done = 0;
>  #local num = 0;
>  #while ( done != 1 )
>   #local norm = <0,0,0>;
>   #local inter = trace( obj, current, dir, norm );
>   #if ( vlength( norm ) != 0 )
>    #local num = num + 1;
>    #local current = inter + <0.0001,0,0>;
>   #else
>    #local done = 1;
>   #end
>  #end
>  (mod( num, 2 ) = 1)
> #end
>
> Cheers,
> Edouard.

Forgive me for being slow as usual, but could you could help me understand your
macro?

I suppose you could used the inside test to fill up the inside of a mesh with
cubes to make CSG approximation of a mesh shape--but that doesn't appear to be
what you did.


Post a reply to this message

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