POV-Ray : Newsgroups : povray.animations : Scale animation problem Server Time
23 Nov 2024 09:28:43 EST (-0500)
  Scale animation problem (Message 1 to 2 of 2)  
From: gregtom6
Subject: Scale animation problem
Date: 1 May 2011 10:55:00
Message: <web.4dbd7366493e38efc0be34760@news.povray.org>
Hy all!

My problem is the following:
#declare sk=1;
#if (clock<55)no_image
#end
#if(clock>=55)
#if((clock-54)*5<25.9)#declare sk=(clock-54)*5;
#else #declare sk=25.9;
#end
#end
scale <sk,sk,sk>

When clock reaches the 55 value, it should be scale in every clock after that,
and when sk would be =30, then it scale get 25.9.
My problem is nothing happens. But why?
the object I try to animate remains invisible.
Help me, pls.

If I write scale 25.9, the object appeares good.


Post a reply to this message

From: Alain
Subject: Re: Scale animation problem
Date: 1 May 2011 13:15:20
Message: <4dbd9528$1@news.povray.org>

> Hy all!
>
> My problem is the following:
> #declare sk=1;
> #if (clock<55)no_image
> #end
> #if(clock>=55)
> #if((clock-54)*5<25.9)#declare sk=(clock-54)*5;
> #else #declare sk=25.9;
> #end
> #end
> scale<sk,sk,sk>
>
> When clock reaches the 55 value, it should be scale in every clock after that,
> and when sk would be =30, then it scale get 25.9.
> My problem is nothing happens. But why?
> the object I try to animate remains invisible.
> Help me, pls.
>
> If I write scale 25.9, the object appeares good.
>
>

It depends on how you use the clock and initiate your animation.
If, for example, you start your animation using +kff100, then, the clock 
variable will go from 0 to 1. It will nefer reatch the value of 55, and 
thus, the first #if will always evaluate as true and set no_image.

Change the your code as follow:
#declare sk=1;
#if (clock< 0.55)no_image
#end
#if(clock>= 0.55)
#if((clock- 0.54)*5<0.259)#declare sk=(clock- 0.54)*5;
#else #declare sk=25.9;
#end
#end
scale <sk,sk,sk>

Then, you can combine the tests:
#if (clock < 0.55) no_image
#else // This replace "#if(clock>= 0.55)"
#if((clock- 0.54)*5 <0.259) #declare sk=(clock- 0.54)*5;
#else #declare sk=25.9;
#end
#end


You may need to adjust the value of the sk variable to acount for the 
effective range of the clock variable and it's derived values.


Alain


Post a reply to this message

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