POV-Ray : Newsgroups : povray.general : Dumb clock animation question : Re: Dumb clock animation question Server Time
16 Apr 2024 00:17:41 EDT (-0400)
  Re: Dumb clock animation question  
From: Alain
Date: 17 Feb 2019 12:36:11
Message: <5c699b8b@news.povray.org>
Le 19-02-17 à 05:36, Mike Horvath a écrit :
> This involves probably some very easy algebra.
> 
> I want a cylinder to spin 360 degrees when the clock is between 0 and 
> 0.6667. I want another object to spin when the clock is between 0.3333 
> and 0.6667. Finally I want the camera to rotate 90 degrees when the 
> clock is between 0.6667 and 1.
> 
> How do I set this up? Thanks.
> 
> 
> Michael

Assuming that the clock goes from 0 to 1 :
To be added to the object of interest.

First case :
#if(clock <= 2/3) rotate x*360*3/2 #end
// *360 for a full rotation
// *3/2 adjust to the desired clock interval

Second case :
#if(clock > 1/3 & clock < 2/3) rotate y*(clock - 1/3)*720*3/2 #end
// *720 two full rotation, just because...

Third case :
#if(clock > 2/3) rotate z*(clock - 2/3)*90*3 #end


That should do it.

Alain


Post a reply to this message

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