POV-Ray : Newsgroups : povray.general : moving things around : Re: moving things around Server Time
2 May 2024 09:04:56 EDT (-0400)
  Re: moving things around  
From: Richard S
Date: 30 May 2017 01:15:00
Message: <web.592cff3652c7950d5b33a3c00@news.povray.org>
Thank you all for your contributions, whilst a solution was not found the
discussion did lead me to look elsewhere in the help file and come up with this
idea which now works just fine.
What I have done is to modify the clock var, which I will have to return back to
my standard later, for the negative movement I have to make a negative going


3.2.1.2 Internal Animation Loop
and
2.3.9.2 Clock Dependant Variables And Multi-Stage Animations
When I do an animation I normally use a 25FPS rate and the clock runs at 1
integer per second whereas here I have had to modify the clock used as the
control to 0 to 1 for the duration of the movement. The clock will have to be
modified to account for this but I think this should be easy to do later on.

//==================Start code======================
#switch(MyClock)
  #range(0,1)//centre to full left
    #debug concat("First Bit = 50 to 0.\n")
    #local MinClock= 0;
    #local MaxClock= 1;
    #local MyClock=MyClock-0;
    #local MinMove = 50;
    #local MaxMove = 0;
  #break
  #range(1,2)//full left to center
    #debug concat("Second Bit = 0 to 50.\n")
    #local MinClock= 1;
    #local MaxClock= 2;
    #local MyClock=MyClock-1;
    #local MinMove = 0;
    #local MaxMove = 50;
  #break
  #range(2,3)//center to right// doe werk
    #debug concat("Third Bit = 50 to 100.\n")
    #local MinClock= 2;
    #local MaxClock= 3;
    #local MyClock=MyClock-2;
    #local MinMove = 50;
    #local MaxMove = 100;
  #break
  #range(3,4)//right to center// doe werk
    #debug concat("Fourth Bit = 100 to 50.\n")
    #local MinClock= 3;
    #local MaxClock= 4;
    #local MyClock=MyClock-3;
    #local MinMove = 100;
    #local MaxMove = 50;
  #break
  #else
    #error concat("MyClock=",str(MyClock,0,0),".\n")
#end

#if(MaxMove<MinMove)
  #local NewClock=1-MyClock;
#else
  #local NewClock=MyClock;
#end

#local
Ans=(min(MaxMove,MinMove)+(NewClock*(max(MaxMove,MinMove)-min(MaxMove,MinMove))));
//==================End code======================


Thank you all for your contributions, whether they were just plain wrong or not,
as the thinking behind them can often lead me and other to look in a different
direction, one I had not previously thought of.

hideous crime. With a natural sentence of wasting time and effort until I see
the light.

Thank you all for your help, and posting my intellectual bail.

Thank you all again.


Post a reply to this message

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