POV-Ray : Newsgroups : povray.animations : alternating objects depending on Z value of spline vector animation : alternating objects depending on Z value of spline vector animation Server Time
17 May 2024 20:47:11 EDT (-0400)
  alternating objects depending on Z value of spline vector animation  
From: CAD-Andi
Date: 19 Sep 2010 19:05:01
Message: <web.4c9695f2878a51c8fdfcf7500@news.povray.org>
Hello!

I'm controlling the location of a object by the use of a spline (see code
below).
I'm only rendering the exact frames given in the spline. That's why the control
points don't matter to me.

Initial_Frame=1
Final_Frame=12
Initial_Clock=0
Final_Clock=11

I need to switch to a different object when the Z-Value reaches a certain limit.
(See fake code line below).

a) How can something like this be done?
b) is there a easier more elegant way to switch location of an object than
"mis-using" a spline?

Thanks!

#### code ####

#declare TARGET=
cylinder {<0,0,0><0,0,400>,200 pigment {rgb <0,1,0>} finish {ambient 0.5}}

#declare TARGET2=
cylinder {<0,0,0><0,0,600>,200 pigment {rgb <1,0,0>} finish {ambient 0.5}}

#declare Spline_1 =
  spline {
   natural_spline
  -1, <-0,0,0>,//control point
   0, <-20000,-10000,1000>,//start point
   1, <-20000,-9000,1000>,
   2, <-20000,-8000,1000>,
   3, <-20000,-7000,1000>
   4, <-20000,-6000,1000>,
   5, <-20000,-5000,1000>,
   6, <-20000,-10000,2000>,
   7, <-20000,-9000,2000>,
   8, <-20000,-8000,2000>,
   9, <-20000,-7000,2000>
 10, <-20000,-6000,2000>,
 11, <-20000,-5000,2000>,
 12, <0,0,0>//control point
  }

#if (Z-value of Spline_1(clock) is less or equal 1000 ) // Is something like
this possible? If yes, how?
 object {TARGET translate Spline_1(clock)}
#else
 object {TARGET2 translate Spline_1(clock)}
#end


Post a reply to this message

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