|
Spline Curves as Animation Pfaths:
To let an object fly along a spline curve defined by a spline i.e. called "Spline_1(..)" is not the problem:
We just use the simple statement "translate Spline_1(clock)"
Sample:
sphere{ <0,0,0>, 0.25
texture{
pigment{ color Red}
finish { diffuse 0.9
phong 1}
} // end of texture
translate Spline_1(clock) //<--!!
} // end of sphere -------------
|
|
|
The Spline_Trans Makro made by Rune S. Johansen
The Orientation of objects along a spline curve
A special problem causes the adaption of the orientation of an object to a
spline curve used as animation pfath. The question: How can we bring an airplane on a spline curve in a manner
that its turning correctly in the right direction?
The perfect solution of this problem brings the
Spline_Trans Makro made by Rune S. Johansen.
This is a feature of POV-Ray!
For using this macro we need to include the include file transforms.inc by:
#include "transforms.inc"
(Note: this includes also "math.inc")
Now we need our flying object being definded in flight direction +z.
|
|
Syntax of this macro:
(See also in the text of "transforms.inc"!)
Spline_Trans(SplineName, TimeValue, Upwards, ForeSight, Banking)
Die Parameter im einzelnen:
SplineName = The name of the used spline function.
TimeValue = The time value to feed to the spline, i.e. "clock"
Upwards = The vector that is upwards in your scene, usually "y " or "<0,1,0>.
ForeSight = A positive value that controls how much in advance the object will turn and bank.
Values close to 0 will give precise results, while higher values give smoother results. It will not affect
parsing speed, so just find the value that looks best.
Banking = How much the object tilts when turning. The amount of tilting is equally
much controlled by the ForeSight value.
Sample: object {My_Object Spline_Trans( My_Spline, clock, y, 0.05, 0.70)}
|