POV-Ray : Newsgroups : povray.animations : Animation Control (time frames I Guess) Server Time
24 Nov 2024 00:52:58 EST (-0500)
  Animation Control (time frames I Guess) (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Marc Champagne
Subject: Animation Control (time frames I Guess)
Date: 13 Sep 2003 23:14:20
Message: <Xns93F5EBFDF15EFPOVMIKA@204.213.191.226>
Hi again!

During an animation sequence, if an object is to:

    	do something for 2 seconds
    	stay idle for 3 seconds
    	do something for 3 seconds

What method or methods have any of you used in your code for
this type of control? 

Assuming:

    	+kff???
    	+ki0 (default)
    	+kf1 (default)
    	And that we encode the final animation at 25 fps.

Would one use something like this to figure out where in time
we are? 

#declare T = frame_number / 25 ;

#if ( T<2 | ( T>5 & T<8 ) )
    	do something
#end

This seems obvious but maybe there are other proven
techniques one could use. 

Thanks

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Hughes, B 
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 03:46:00
Message: <3f641cb8$1@news.povray.org>
"Marc Champagne" <marcch.AT.videotron.DOT.ca> wrote in message
news:Xns### [at] 204213191226...
>
> During an animation sequence, if an object is to:
>
>     do something for 2 seconds
>     stay idle for 3 seconds
>     do something for 3 seconds
>
> Assuming:
>
>     +kff???
>     +ki0 (default)
>     +kf1 (default)
>     And that we encode the final animation at 25 fps.
>
> Would one use something like this to figure out where in time
> we are?
>
> #declare T = frame_number / 25 ;
>
> #if ( T<2 | ( T>5 & T<8 ) )
>     do something
> #end

Seems okay to me. There's #range, used in #switch directive, that I might
use for this kind of purpose too. Goes like so:

#switch (T)
#range (0,2)
/* do first thing */
#break
#range (5,8)
/* do second thing */
#break
#end

Except this wouldn't prevent the exact values 2, 5 and 8 from being taken
into account; unlike your #if directive method, which I'd say is perfectly
fine in that particular example. You just don't need the parenthesis around
T>5&T<8 for it to work right, I believe.

Bob H.


Post a reply to this message

From: Marc Champagne
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 07:09:09
Message: <Xns93F6485B1CEA6POVMIKA@204.213.191.226>
"Hughes, B." <omn### [at] charternet> wrote in
news:3f641cb8$1@news.povray.org: 

>> "Marc Champagne" <marcch.AT.videotron.DOT.ca> wrote in
>> message news:Xns### [at] 204213191226...
>>
>> During an animation sequence, if an object is to:
>>
>>     do something for 2 seconds
>>     stay idle for 3 seconds
>>     do something for 3 seconds
>>
>> Assuming:
>>
>>     +kff???
>>     +ki0 (default)
>>     +kf1 (default)
>>     And that we encode the final animation at 25 fps.
>>
>> Would one use something like this to figure out where in
>> time we are?
>>
>> #declare T = frame_number / 25 ;
>>
>> #if ( T<2 | ( T>5 & T<8 ) )
>>     do something
>> #end

> Seems okay to me. There's #range, used in #switch
> directive, that I might use for this kind of purpose too.
> Goes like so: 
> 
> #switch (T)
> #range (0,2)
> /* do first thing */
> #break
> #range (5,8)
> /* do second thing */
> #break
> #end
> 
> Except this wouldn't prevent the exact values 2, 5 and 8
> from being taken into account;

For (#range) the docs say:

  If Low_Value <= Switch_Value and Switch_Value<=High_Value
  then the condition is true. 

I havn't tried #range directive yet, maybe there is a bug
that i'm not aware of? 

> unlike your #if directive method, which I'd say is
> perfectly fine in that particular example. You just don't
> need the parenthesis around T>5&T<8 for it to work right, I
> believe. 

The parenthesis just makes things absolutely "clear", I never
liked relying on precedence. 

Thanks

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Slime
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 12:42:37
Message: <3f649a7d$1@news.povray.org>
> #declare T = frame_number / 25 ;

If you're basing your animation off of the frame_number, then the usage of
the clock is useless. In addition, if you later decide you want to render
with 30fps, you have to change the *scene*, rather than just the command
line parameters.

I would suggest having the clock go from 0 to 5, and render 25*5 = 125
frames (0 through 124). Then, in the code, you can just use

#if ( clock<2 | ( clock>5 & clock<8 ) )

This way, the clock is always measured in seconds, and if you ever decide
that you want a different number of frames per second, all you do is change
the number of frames.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Marc Champagne
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 12:55:44
Message: <Xns93F6831E96581POVMIKA@204.213.191.226>
"Slime" <fak### [at] emailaddress> wrote in
news:3f649a7d$1@news.povray.org: 

>> #declare T = frame_number / 25 ;
> 
> If you're basing your animation off of the frame_number,
> then the usage of the clock is useless. In addition, if you
> later decide you want to render with 30fps, you have to
> change the *scene*, rather than just the command line
> parameters. 
> 
> I would suggest having the clock go from 0 to 5, and render
> 25*5 = 125 frames (0 through 124). Then, in the code, you
> can just use 
> 
> #if ( clock<2 | ( clock>5 & clock<8 ) )
> 
> This way, the clock is always measured in seconds, and if
> you ever decide that you want a different number of frames
> per second, all you do is change the number of frames.

A lot more practical this way!

Thanks for the tip

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Dennis Miller
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 18:56:34
Message: <3f64f222$1@news.povray.org>
I, for one, would use Chris Colefax's autoclck.mcr and clockmod.inc:

 #declare CLCK = (From (0, 0)  To (.250, 1)  To (.625, 1)  To (1, 0)  ) ;
or whatever. The values are totally negotiable based on whatever clock range
you use.

Extremely useful, and the movement over any range of frames does not have to
be linear (accelerate, decelerate, Bounce, Wave, etc.)


d.


"Marc Champagne" <marcch.AT.videotron.DOT.ca> wrote in message
news:Xns### [at] 204213191226...
> Hi again!
>
> During an animation sequence, if an object is to:
>
>     do something for 2 seconds
>     stay idle for 3 seconds
>     do something for 3 seconds
>
> What method or methods have any of you used in your code for
> this type of control?
>
> Assuming:
>
>     +kff???
>     +ki0 (default)
>     +kf1 (default)
>     And that we encode the final animation at 25 fps.
>
> Would one use something like this to figure out where in time
> we are?
>
> #declare T = frame_number / 25 ;
>
> #if ( T<2 | ( T>5 & T<8 ) )
>     do something
> #end
>
> This seems obvious but maybe there are other proven
> techniques one could use.
>
> Thanks
>
> -- 
> Marc Champagne
> marcch.AT.videotron.DOT.ca
> Montreal, CANADA


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 19:06:25
Message: <3f64f471@news.povray.org>
I've always done it the same way:

#declare Animation_Time = [Seconds];
#declare Animation_FPS = 25;

These are two basic parameters all my newer Include-
Files making use of animation-capabilities use. I've even
included a small script inside my LSSM which derives
the amount of frames from POV-Internal-Data. Based
on FPS, it can then calculate the amount of seconds.

And then, I either set my animations with values from
0 to 1 (beginning to end of animation) or with values
from 0 to clock*Animation_Time (beginning to end
of animation in seconds).

Now, thats not much for HOW to actually set things
up, but sticking to a certain, obvious style, makes
things easier in the long run. In this case, someone
else can easily set the LSSM and my Particle-System
into one scene, without having to mix different kinds
of timing systems. Also, I like to think in seconds,
rather than animation time. Its easier to visualize.

Most of the time, I do use
#if (clock*Animation_Time < 3)
...
#else
...
#end
or something alike.To have a handy value for any range,
I simply subtract the time when something begins, and
divide it resulting value by the timespan until the next
event occurs.
E.g: Animate from 3rd sec to 5th sec:
#if (clock*Animation_Time>=3 & clock*Animation_Time<=5)
 #declare LocalClock=(clock*Animation_Time-3)/2;
 ...
#end

LocalClock will then run from 0 to 1 during those 2 seconds,
and things can be animated very easily with values from 0 to
1 IMHO.

Regards,
Tim

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: no_lights (@) digitaltwilight.de

> Hi again!
>
> During an animation sequence, if an object is to:
>
>     do something for 2 seconds
>     stay idle for 3 seconds
>     do something for 3 seconds
>
> What method or methods have any of you used in your code for
> this type of control?
>
> Assuming:
>
>     +kff???
>     +ki0 (default)
>     +kf1 (default)
>     And that we encode the final animation at 25 fps.
>
> Would one use something like this to figure out where in time
> we are?
>
> #declare T = frame_number / 25 ;
>
> #if ( T<2 | ( T>5 & T<8 ) )
>     do something
> #end
>
> This seems obvious but maybe there are other proven
> techniques one could use.
>
> Thanks
>
> -- 
> Marc Champagne
> marcch.AT.videotron.DOT.ca
> Montreal, CANADA


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 02.09.2003


Post a reply to this message

From: Marc Champagne
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 19:45:24
Message: <Xns93F6C8938DB25POVMIKA@204.213.191.226>
"Dennis Miller" <dhm### [at] comcastnet> wrote in
news:3f64f222$1@news.povray.org: 

> I, for one, would use Chris Colefax's autoclck.mcr and
> clockmod.inc: 
> 
>  #declare CLCK = (From (0, 0)  To (.250, 1)  To (.625, 1) 
>  To (1, 0)  ) ; 
> or whatever. The values are totally negotiable based on
> whatever clock range you use.
> 
> Extremely useful, and the movement over any range of frames
> does not have to be linear (accelerate, decelerate, Bounce,
> Wave, etc.) 

Eh hum..well a couple of hours ago I discouvered Chris's
macros & includes and have been fiddling with it, very
interesting in dead. 

Looks very promising, this kinda stuff should be built in to
POV :) 

Thanks

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Marc Champagne
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 19:48:52
Message: <Xns93F6C92A3B518POVMIKA@204.213.191.226>
"Tim Nikias v2.0" <no_lights (@) digitaltwilight.de> wrote in
news:3f64f471@news.povray.org: 

> I've always done it the same way:
> 
> #declare Animation_Time = [Seconds];
> #declare Animation_FPS = 25;
> 
> These are two basic parameters all my newer Include-
> Files making use of animation-capabilities use. I've even
> included a small script inside my LSSM which derives
> the amount of frames from POV-Internal-Data. Based
> on FPS, it can then calculate the amount of seconds.
> 
> And then, I either set my animations with values from
> 0 to 1 (beginning to end of animation) or with values
> from 0 to clock*Animation_Time (beginning to end
> of animation in seconds).
> 
> Now, thats not much for HOW to actually set things
> up, but sticking to a certain, obvious style, makes
> things easier in the long run. In this case, someone
> else can easily set the LSSM and my Particle-System
> into one scene, without having to mix different kinds
> of timing systems. Also, I like to think in seconds,
> rather than animation time. Its easier to visualize.
> 
> Most of the time, I do use
> #if (clock*Animation_Time < 3)
> ...
> #else
> ...
> #end
> or something alike.To have a handy value for any range,
> I simply subtract the time when something begins, and
> divide it resulting value by the timespan until the next
> event occurs.
> E.g: Animate from 3rd sec to 5th sec:
> #if (clock*Animation_Time>=3 & clock*Animation_Time<=5)
>  #declare LocalClock=(clock*Animation_Time-3)/2;
>  ...
> #end
> 
> LocalClock will then run from 0 to 1 during those 2
> seconds, and things can be animated very easily with values
> from 0 to 1 IMHO.

I like this LocalClock idea!

I managed to find Chris Colefax's animation macros and
managing object in time is pretty simplified. 

Thanks

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Slime
Subject: Re: Animation Control (time frames I Guess)
Date: 14 Sep 2003 21:19:42
Message: <3f6513ae$1@news.povray.org>
> in dead

"indeed" =)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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