POV-Ray : Newsgroups : povray.binaries.images : tractor 2008 (164k jpg) : Re: tractor 2008 (164k jpg) Server Time
30 Jul 2024 20:27:47 EDT (-0400)
  Re: tractor 2008 (164k jpg)  
From: stbenge
Date: 7 Dec 2008 17:28:29
Message: <493c4e0d@news.povray.org>
Edouard Poor 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 )

Hi Edouard,

I thought using the "i" word might get somebody to think of a solution 
:) I tried the macro, and it seems to work very well. It's not as slow 
as I thought it would be! I'm not sure if I understand the code 
completely. It traces lines through the mesh, and if the number of 
intersections is odd, it considers the point of reference inside, right? 
I don't have any formal schooling in higher math, so I do not understand 
this line:

(mod( num, 2 ) = 1)

The POV docs say mod(A,B) returns the remainder of the integer division 
of A/B. I can understand that. But how does this work when you say it 
equals 1? Is this like a conditional statement?

And I don't comprehend what you mean when you say I can improve your 
macro with the equivalent of an inside_vector. Would I simply add 
another parameter which would pass a vector to #local dir ?

May I use your code in my next distribution of my proximity macros? I'll 
give you credit, of course :)

Sam


Post a reply to this message

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