POV-Ray : Newsgroups : povray.newusers : Problem with nested function calls Server Time
25 Nov 2024 05:41:49 EST (-0500)
  Problem with nested function calls (Message 1 to 4 of 4)  
From: curtmack
Subject: Problem with nested function calls
Date: 16 Jul 2006 17:55:00
Message: <web.44bab5931f04489193400c860@news.povray.org>
The image I'm trying to render is far to complicated to explain in a brief
post, so I'll just post the problematic code and the #declares at the
beginning of the file.



#declare circlerad = 3;
#declare bandrad = (circlerad*14)/(2*pi);
#declare cangle = 14/360;
#declare stringthick = .1;


#macro getpoint (c,d)
  vaxis_rotate( vaxis_rotate(<circlerad,0,bandrad>,z,d*10), y,(c-1)*cangle)
#end



The basic idea is that getpoint should return the point that is d*10 degress
around the circle numbered c. The circles are numbered starting from c=0,
going ccw, and spaced evenly around the outside "band" so that there are 14
in all. The -1 is for clarity (so that the numbers start at #1).

But getpoint doesn't return the proper points. The value that it seems to be
returning is actually:

vaxis_rotate(<circlerad,0,bandrad>,z,d*10)

no matter what value of c is passed.

I'm sorry if the problem is a bit confusing without knowing the rest of the
code, but it's a long file. I'll post it if needed though.


Post a reply to this message

From: Slime
Subject: Re: Problem with nested function calls
Date: 16 Jul 2006 18:09:15
Message: <44bab90b$1@news.povray.org>
I think you want

#declare cangle = 360/14;

Instead of 14/360, which is such a small angle that it's not surprising you
don't see any rotation.

Separately, I think this

#declare bandrad = (circlerad*14)/(2*pi);

should probably be

#declare bandrad = (circlerad*2*14)/(2*pi);

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: curtmack
Subject: Re: Problem with nested function calls
Date: 17 Jul 2006 10:00:01
Message: <web.44bb96a9972bcc8e93400c860@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> I think you want
>
> #declare cangle = 360/14;
>
> Instead of 14/360, which is such a small angle that it's not surprising you
> don't see any rotation.
>


Yeah, that makes sense now that I think about it. Thanks!


Post a reply to this message

From: NEWS
Subject: Re: Problem with nested function calls
Date: 17 Jul 2006 10:37:15
Message: <44bba09b$1@news.povray.org>
are you sure that Cangle value is in radian ... cause you wrote
cangle=14/360 instead of 14*2*pi/360




news:web.44bab5931f04489193400c860@news.povray.org...
> The image I'm trying to render is far to complicated to explain in a brief
> post, so I'll just post the problematic code and the #declares at the
> beginning of the file.
>
>
>
> #declare circlerad = 3;
> #declare bandrad = (circlerad*14)/(2*pi);
> #declare cangle = 14/360;
> #declare stringthick = .1;
>
>
> #macro getpoint (c,d)
>   vaxis_rotate( vaxis_rotate(<circlerad,0,bandrad>,z,d*10),
y,(c-1)*cangle)
> #end
>
>
>
> The basic idea is that getpoint should return the point that is d*10
degress
> around the circle numbered c. The circles are numbered starting from c=0,
> going ccw, and spaced evenly around the outside "band" so that there are
14
> in all. The -1 is for clarity (so that the numbers start at #1).
>
> But getpoint doesn't return the proper points. The value that it seems to
be
> returning is actually:
>
> vaxis_rotate(<circlerad,0,bandrad>,z,d*10)
>
> no matter what value of c is passed.
>
> I'm sorry if the problem is a bit confusing without knowing the rest of
the
> code, but it's a long file. I'll post it if needed though.
>
>


Post a reply to this message

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