POV-Ray : Newsgroups : povray.general : Animation Error : Re: Animation Error Server Time
29 Jul 2024 12:16:18 EDT (-0400)
  Re: Animation Error  
From: Alain
Date: 28 Aug 2011 17:33:04
Message: <4e5ab410$1@news.povray.org>

> Hello,
>
> many many thanks Clipka&  Alain for your advices
>
> you just made my day :)
>
> It's work now,
>
> but I have some questions,
>
> 1. The control points are for me not clearly,What is the task of control point
> in this macro? Why should I define a control point by [-1] and by [25]even if I
> have frames from 0 to 24 (25 in my case)?

A control point is a point that is NOT realy part of the spline but 
control it's shape at the end points. The point at [-1] control the 
shape at point [0] and the one at [25] control the shape at [24]

>
> 2.Can I define the spline points with a parameter? I mean for expl. if I want to
> declare 50  frames(pictures), it will be take long time to type it for each
> frame the declaration of points?

You don't need to define the spline at every points. For example, with 
your original cubic_spline, if you read points between any 2 points 
you'll get intermediate values. In fact, you could have skipped about 2 
thirds of the points and still have roughly the same path. The values 
between the explicitely defined points are interpolated along a smooth 
curved path.

To see the efective path of your spline, I used a #while loop to place 
small spheres with a step value of 0.25 giving me 3 intermediate points 
for each defined points. I could have used a step value of 0.01 if I 
wanted to and got 99 intermediate locations.

here is the code:
#declare Spl_Pos = 0;
#declare Steps = 1/4;
union{
	#while(Spl_Pos < 25)
		sphere{MySpline(Spl_Pos)-1*y, 0.02}
		#declare Spl_Pos=Spl_Pos + Steps;
	#end
	pigment{rgb<1,1,0>}
	}


>
> In my case, If I want to get the cars in following time in this position
> 1-Clock 0,<1,30,0,2.60] Start
> 2-Clock*1/8<0,0,1.3>
> 3-clock*2/8<-1.3,0,0>
> 4-clock*3/8<0,0,-1.3>
> 5-clock*4/8<1.3,0,0>
> 6-clock*5/8<0,0,1.3>
> 7-clock*6/8<-1.3,0,2.6>
> 8-clock*7/8<0,0,3.9>
> 9-clock*8/8<1.3,0,2.6>  End
>
> But 50 frames from clock 0 to clock 1.
> How should I declare spline point cleverly, that I avoid to type 50 points?

No, your original 24 points are more than suficient to the task. You can 
keep your code exactly the same and just change the final frame from 25 
to 50, or whatever value like 100 or 10000, without any problem.

>
>
> (I have tried following defination for spline points
> clock*50,<1.30*cos(2*pi*clock),0,2.60+1.3*sin(2*pi*clock)>
> But it doesn't work, what I expected.
> )

During a given frame, clock always have a single value. That value will 
change for the next frame and cause the shape to change.

>
> Many Thanks in advance for your advices
> Yetkin
>
>


Post a reply to this message

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