POV-Ray : Newsgroups : povray.general : Using 'frame number' in #switch (=Bob) Server Time
15 Nov 2024 21:14:09 EST (-0500)
  Using 'frame number' in #switch (=Bob) (Message 1 to 5 of 5)  
From: Andrew Cocker
Subject: Using 'frame number' in #switch (=Bob)
Date: 2 Dec 1998 15:57:17
Message: <3665a9ad.0@news.povray.org>
Hi,
    =Bob pointed me in the right direction with this one, but I'm still
having difficulties.

I want to use

#switch (FC)

where frame count FC=frame number

but how do I #declare FC to equal whatever frame the animation is rendering
at any one point, ie on frame 45 - FC=45.

thankyou,

Andy


--
--------------------------
and### [at] acockerfreeservecouk


Post a reply to this message

From: Ronald L  Parker
Subject: Re: Using 'frame number' in #switch (=Bob)
Date: 2 Dec 1998 20:45:50
Message: <3665ed20.102278195@news.povray.org>
On Wed, 2 Dec 1998 20:56:50 -0000, "Andrew Cocker"
<and### [at] acockerfreeservecouk> wrote:

>I want to use
>
>#switch (FC)
>
>where frame count FC=frame number
>
>but how do I #declare FC to equal whatever frame the animation is rendering
>at any one point, ie on frame 45 - FC=45.


I think you can use 

#declare FC=clock/clock_delta + StartingFrameNumber

assuming your clock goes from 0 to 1, but you'll have
to set StartingFrameNumber yourself.


Post a reply to this message

From: =Bob
Subject: Re: Using 'frame number' in #switch (=Bob)
Date: 2 Dec 1998 22:58:49
Message: <36660c79.0@news.povray.org>
Oops, sorry, I neglected to point out that an INI file is needed (or 
command-line switches) telling the animation to use the clock for a frame 
count, not frame numbers (still use frames though). As in:
Initial_Clock=0
Final_Clock=59
for a 60 frame animation.
Or +ki0 +kf59 command-line style.
And then #declare FC=clock in your scene file.
This neccessitates a new clock value for getting back to a regular old clock 
of 0 to 1 however.
#declare _C_ = clock/59
is how I do it. This is basically Ronald L. Parkers suggestion below.
It does get messy as you can plainly see, especially if other parameters are 
wanted for frame count (start/end too), clock values, etc.
Trying to make a clock 0 to 1 in the usual way and telling your scene file to 
use a int(clock*60) is a possibility but I don't trust the math.
Hope your on your way well enough now ;)

Message <3665ed20.102278195@news.povray.org>, Ronald L. Parker typed...
>
>On Wed, 2 Dec 1998 20:56:50 -0000, "Andrew Cocker"
><and### [at] acockerfreeservecouk> wrote:
>
>>I want to use
>>
>>#switch (FC)
>>
>>where frame count FC=frame number
>>
>>but how do I #declare FC to equal whatever frame the animation is rendering
>>at any one point, ie on frame 45 - FC=45.
>
>
>I think you can use 
>
>#declare FC=clock/clock_delta + StartingFrameNumber
>
>assuming your clock goes from 0 to 1, but you'll have
>to set StartingFrameNumber yourself.
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Ron Parker
Subject: Re: Using 'frame number' in #switch (=Bob)
Date: 3 Dec 1998 08:44:55
Message: <366695d7.0@news.povray.org>
On 2 Dec 1998 22:58:49 -0500, =Bob <ver### [at] aolcom> wrote:
>#declare _C_ = clock/59
>is how I do it. This is basically Ronald L. Parkers suggestion below.

Except that clock_delta is a reserved word in 3.1, and it evaluates
to the difference between the clocks for two consecutive frames.
Thus, the only thing you need is the starting frame number.


Post a reply to this message

From: =Bob
Subject: Re: Using 'frame number' in #switch (=Bob)
Date: 3 Dec 1998 15:21:55
Message: <3666f2e3.0@news.povray.org>
Good to know, thanks.

Message <366695d7.0@news.povray.org>, Ron Parker typed...
>
>On 2 Dec 1998 22:58:49 -0500, =Bob <ver### [at] aolcom> wrote:
>>#declare _C_ = clock/59
>>is how I do it. This is basically Ronald L. Parkers suggestion below.
>
>Except that clock_delta is a reserved word in 3.1, and it evaluates
>to the difference between the clocks for two consecutive frames.
>Thus, the only thing you need is the starting frame number.

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

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