POV-Ray : Newsgroups : povray.general : Buggy trig? : Re: Buggy trig? Server Time
9 Aug 2024 17:21:52 EDT (-0400)
  Re: Buggy trig?  
From: Chris Colefax
Date: 3 Jun 2000 20:50:20
Message: <3939a7cc@news.povray.org>
Xplo Eristotle <inq### [at] unforgettablecom> wrote:
> Playing with the animation stuff, I produced this simple scene:
[snip]
> As I understand it, this should produce a nice loop; starting from no
> rotation (clock = 0, sin(0) = 0), the right end of the text should be
> rotated toward the camera while the left end falls away until a quarter
> of the way through the animation, where the rotation reaches -20 degrees
> (clock = ~.25, sin(360*.25) = 1). Then, it should rotate back the way it
> came until halfway through (sin(360*.5) = 0) and then keep rotating that
> direction until 3/4 of the way through the animation where it reaches 20
> degrees (sin(360*.75) = -1). And finally, it should rotate back again
> until it reaches no rotation.
>
> Problem: it doesn't do this. It seems like the sin function is returning
> incorrect values, since when I rendered the animation and dumped the
> frames in a GIF animator, the animation didn't describe a full loop.
> Instead, it acted as though the function had been sin(clock*270),
> starting from no rotation and ending up at 20 degrees rotation.

Or, it seems the sin function is returning the correct values, based on the
fact that it accepts the input angle in radians rather than degrees.  Try
changing your statement to:

   rotate <0,-20*sin(clock*2*pi),0>

and things should work as you expect.


Post a reply to this message

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