POV-Ray : Newsgroups : povray.animations : A sign rotating back and forth. : Re: A sign rotating back and forth. Server Time
1 Jun 2024 07:42:43 EDT (-0400)
  Re: A sign rotating back and forth.  
From: RusHHouR
Date: 6 May 2006 12:00:01
Message: <web.445cc6ee24781bb447d3ae5e0@news.povray.org>
Hmmmm.... Chris! Would you mind helping me a bit more? please...?

http://download.yousendit.com/75D992413B17076C

If i blink in a constant rythm, it looks ok! ;)

Seriously though, what needs to be added to make it move a bit smoother in
both directions? I dont understand this code (which of course bothers me)
so Im a bit afraid of trying to tweak it out of control...

Used:

//------------------------

#include "math.inc"

#declare MyClock = clock*5;
#declare SecondsPerCycle = 1; // One complete flap every 2 seconds

// Calculate a number that varies linearly between -1 and +1 over the cycle
#declare CyclePosition = mod(MyClock,SecondsPerCycle)*2-1;

// Apply a sine function to give a value that stays out at the extremes
longer
#declare CycleFactor = sind(90*CyclePosition);



object {skylt
rotate x*(CycleFactor*7.5-2.5)
translate <0.2,3.9,0>}


//------------------------


Post a reply to this message

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