POV-Ray : Newsgroups : povray.animations : alternating objects depending on Z value of spline vector animation Server Time
24 Apr 2024 14:52:44 EDT (-0400)
  alternating objects depending on Z value of spline vector animation (Message 1 to 5 of 5)  
From: CAD-Andi
Subject: alternating objects depending on Z value of spline vector animation
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

From: omniverse
Subject: Re: alternating objects depending on Z value of spline vector animation
Date: 19 Sep 2010 23:30:01
Message: <web.4c96d49478c97e55d939a6800@news.povray.org>
"CAD-Andi" <nomail@nomail> wrote:
>
> I'm controlling the location of a object by the use of a spline (see code
> below).
>
> #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

I think this might be what you're looking for.

#if (Spline_1(clock).z <= 1000)


Post a reply to this message

From: CAD-Andi
Subject: Re: alternating objects depending on Z value of spline vector animation
Date: 20 Sep 2010 07:20:00
Message: <web.4c9742d378c97e55fdfcf7500@news.povray.org>
"omniverse" <omn### [at] charternet> wrote:

> > #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
>
> I think this might be what you're looking for.
>
> #if (Spline_1(clock).z <= 1000)

Thanks! Somehow I knew stuff like this is easy in SDL. At least for someone who
knows what he is doing :-)

Cheers!
Andi


Post a reply to this message

From: omniverse
Subject: Re: alternating objects depending on Z value of spline vector animation
Date: 20 Sep 2010 12:35:00
Message: <web.4c978cd878c97e55d939a6800@news.povray.org>
"CAD-Andi" <nomail@nomail> wrote:
> "omniverse" <omn### [at] charternet> wrote:
>
> > > #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
> >
> > I think this might be what you're looking for.
> >
> > #if (Spline_1(clock).z <= 1000)
>
> Thanks! Somehow I knew stuff like this is easy in SDL. At least for someone who
> knows what he is doing :-)

YW! Heh, if only I knew what I was doing in POV-Ray most the time. I seem to
remember a fraction of what I learn.

Bob


Post a reply to this message

From: Kenneth
Subject: Re: alternating objects depending on Z value of spline vector animation
Date: 20 Sep 2010 16:55:01
Message: <web.4c97c91d78c97e55196b08580@news.povray.org>
"omniverse" <omn### [at] charternet> wrote:
> "CAD-Andi" <nomail@nomail> wrote:

> > Thanks! Somehow I knew stuff like this is easy in SDL. At least for someone
> > who knows what he is doing :-)
>
> YW! Heh, if only I knew what I was doing in POV-Ray most the time. I seem to
> remember a fraction of what I learn.
>
> Bob

Ditto. I seem to always be 'reinventing the wheel'--forgetting how to do stuff
that I've already figured out. Lately, I've been creating shortcuts to my
scenes, with different titles, just to remind me of some small discovery I've
made in the code. My memory ain't what it used to be...

Ken


Post a reply to this message

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