POV-Ray : Newsgroups : povray.general : moving things around : Re: moving things around Server Time
2 May 2024 08:14:39 EDT (-0400)
  Re: moving things around  
From: Bald Eagle
Date: 24 May 2017 13:05:00
Message: <web.5925bc4c52c7950dc437ac910@news.povray.org>
Just to get you started, I made a graph of what I think you want.
I believe I mistook your quote of the docs for what you were actually doing.

See if this gets you started / on the right track:


**************************************************************************

#version 3.7;
global_settings { assumed_gamma 1.0}


#include "colors.inc"
#include "math.inc"


camera {
 location <200, 50, -400>
 up y
 right x*image_width/image_height
 look_at <200, 50, 0>
}

// Create an infinite sphere around scene and allow any pigment on it
sky_sphere{ pigment { gradient <0,1,0>
                      color_map { [0.00 rgb <0.6,0.7,1.0>]
                                  [0.25 rgb <0.0,0.1,0.8>/2]
                                  [0.75 rgb <0.0,0.1,0.8>/2]
                                  [1.00 rgb <0.6,0.7,1.0>]
                                }
                      scale 2
                    } // end of pigment
          } //end of skysphere -------------------------------------


light_source { <0, 150, -150>, 1 }

//#declare Start    = 25.0;
//#declare End      = 75.0;
//#declare My_Clock = Start+(End-Start)*clock;

//#declare My_Clock = clock*20;

#declare Line = 1;

#for (X, 0, 400, 100)
cylinder {<X, 0, 0>, <  X, 100, 0> Line pigment {Green}}
#end

#for (Y, 0, 100, 50)
cylinder {<0, Y, 0>, <400,   Y, 0> Line pigment {Red}}
#end

#for (Clock, 0, 20, 0.25)
 #declare My_Clock = Clock*20;

 //----start code segment----
 #switch(Clock)
   #range(0,5)//centre to full left
    #declare Height = 50-(Clock*10);
    sphere {<My_Clock, Height, 0> Line pigment {Black}}
     #local MinClock= 0;
     #local MaxClock= 5;
     #local MinMove = 50;
     #local MaxMove = 0;
   #break
   #range(5,10)//full left to center
   #declare Height = ((Clock-5)*10);
    sphere {<My_Clock, Height, 0> Line pigment {Black}}
     #local MinClock= 5;
     #local MaxClock= 10;
     #local MinMove = 0;
     #local MaxMove = 50;
   #break
   #range(10,15)//center to right
   #declare Height = ((Clock-5)*10);
   sphere {<My_Clock, Height, 0> Line pigment {Black}}
     #local MinClock= 10;
     #local MaxClock= 15;
     #local MinMove = 50;
     #local MaxMove = 100;
   #break
   #range(15,20)//right to center
   #declare Height = 100-((Clock-15)*10);
   sphere {<My_Clock, Height, 0> Line pigment {Black}}
     #local MinClock= 15;
     #local MaxClock= 20;
     #local MinMove = 100;
     #local MaxMove = 50;
   #break
   #else
     //#error concat("MyClock=",str(My_Clock,0,0),".\n")
 #end

#end

#local Mover=
(MinMove+(MaxMove-MinMove))*(My_Clock/(MinClock+(MinClock-MaxClock)));;
//----end code segment----


Post a reply to this message

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