POV-Ray : Newsgroups : povray.binaries.images : tractor 2008 (164k jpg) : Re: tractor 2008 (164k jpg) Server Time
30 Jul 2024 22:25:11 EDT (-0400)
  Re: tractor 2008 (164k jpg)  
From: Edouard Poor
Date: 7 Dec 2008 00:40:01
Message: <web.493b60e562d2e2216349cc2c0@news.povray.org>
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.


Post a reply to this message


Attachments:
Download 'fastprox_bunny.jpg' (19 KB)

Preview of image 'fastprox_bunny.jpg'
fastprox_bunny.jpg


 

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