POV-Ray : Newsgroups : povray.general : Flapping wings? : Re: Flapping wings? Server Time
7 Aug 2024 09:19:38 EDT (-0400)
  Re: Flapping wings?  
From: Josh English
Date: 11 Oct 2001 15:21:41
Message: <3BC5F0F2.B190CE6D@spiritone.com>
Josh English wrote:

> <snip>
> #declare frac_clock = clock - int(clock); // The wave works between 0 and 1,
> but not between 1 and 2
> #declare wing_angle = center_angle + cos(pow(frac_clock,0.8))*amplitude;

Oops. This should be:
#declare wing_angle = center_angle + cos(2*pi*pow(frac_clock,0.8))*amplitude;

This of course gives you the rotation value you're looking for. Without that
2*pi bit you get a really strange motion.
Another thing I could add is that this gives one flap per second, if you want
more flaps per second change the frac_clock definition to:

#declare frac_clock = (clock*2) - int(clock*2);  // Two Flaps per second


--
Josh English
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

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