Home
- 3D Animations Gallery
- POV-Ray Tutorial
3D Animation Tutorial
Index of Content
0. Basic Knowledge
1. Basic Example
2. Example 2
3. Images to Animated Gif
4. From Images to Video
5. Basic Terms
> 6. Animation Commands
I. Cyclic Animations
1. Rotating Objects
1.2. Planets in Orbit
1.3. Clock Animation
2. Rotating Camera
2.1. Straight Moving Camera
3. Western Wheel
Problem
3.1. Rolling Wheels
4. Gears
4.1. Roller Chain
4.2. Bike Chain
5. Swinging Pendulum
5.1. Newton's Cradle
5.2: Rock the Rocker
6. Spiral Pendulum
7. Coupling Rods
7.1. Connecting Rods
8. Psychedelic + Op-Art
9. Counters + Countdowns
10. Folding of a Cube
II. Non-linear Movements
1.0 Speed Up/Slow Down 1
1.1 Speed Up/Slow Down 2
2. Fall + Bounce
3. Acceleration by
physical Formulas
4. Speed Controll by
Spline Functions
III. Animation Paths with Spline Curves
1. Spline Curves
2. Closed Splines
3. Animation Paths
|
Animation Commands
for POV-Ray scene files and animation ini files. |
|
|
The Statements for the animation ini files:
Basic animation statements:
Use ";" instead of "//" for comments in POV-Ray ini files!
Input_File_Name="sphere.pov"
; The name of the POV-Ray file to render.
Initial_Frame=1 ; start with frame_number 1
Final_Frame=10 ; end with frame_number 10
Initial_Clock=0 ; start with clock value 0
Final_Clock=1 ; end with clock value 1 !
Cyclic_Animation=On ; "On" or "Off"
This is very useful for cyclic animations like i.e.
turning an object around by 360 degrees:
It causes to subdivide the clock difference 1 a total of
10 frames in 10 segments and to render with
clock = 0.0, 0.1, 0.2, ..... , 0.8, 0.9 - but not with 1.0 !
So with rotate<0,clock*360,0> an object will turn around
by 0, 36, 72, 108, 144, 180, 216, 252, 288, 324 degrees,
but not by 360, because this is the same as the first frame!
Antialiasing items:
Antialias=On ; Turn it off for test renderings of complex scenes!
Antialias_Threshold=0.3
Antialias_Depth=3
Short description:
Antialiasing is a method to avoid
a stair-step appearance in sloping or curved lines, a broken look for thin lines and moiré patterns of interference by
calculating the color of a pixel by using the average of more than one traced ray.
"Antialias_Depth=3" means POV-Ray uses a 3x3 grid for one pixel
but this also means there is 3x3 = 9 as much to calculate !
"Antialias_Threshold=0.3" means the antialiasing starts (if "Antialias=On" is set) only if the difference
between a new pixel and the previous is bigger than 0.3.
Additional animation statements:
Partial Rendering items:
Subset_Start_Frame=11
Subset_End_Frame=27
With this you can render only part of an animation without changing clock or frame rate.
Frame_Step=3
With this you can render only each 3rd frame (default = 1).
Gamma Correction items:
New in POV-Ray version 3.7 !
Display_Gamma=1.5 ;sets the display gamma to 1.5
File_Gamma=1.5 ;Applies gamma value to the image file.
|
"sphere.ini"
; POV-Ray animation ini file
Antialias=Off
Antialias_Threshold=0.1
Antialias_Depth=2
Input_File_Name=sphere1.pov
Initial_Frame=1
Final_Frame=30
Initial_Clock=0
Final_Clock=1
Cyclic_Animation=on
Pause_when_Done=off | |
Basic animation statements
"sphere.ini" - extended
; Persistence Of Vision raytracer
; version 3.6/3.7
; animation ini example file.
;Display_Gamma=1.5
;File_Gamma=1.5 ; only in version 3.7
Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Input_File_Name=animation2.pov
Initial_Frame=1
Final_Frame=30
Initial_Clock=0
Final_Clock=1
;Subset_Start_Frame=11
;Subset_End_Frame=30
Cyclic_Animation=on
Pause_when_Done=off
| |
Additional animation statements
|
|
Animation values for the use in POV-Ray scene files.
The following animation values can be used in a POV-Ray scene file (.pov)
as values to control the animation flow.
(Note: These values were read from the animation options in the ini file. You cannot re-declare these identifiers!)
Values for clock based animations:
clock the actual clock value
initial_clock ; clock start value
final_clock ; clock end value
(The real last rendered value depends on weather the "Cyclic_Animation" is on or off)
clock is a comfortable way to control animations independent form the total frame number
in use. We can test animations with a small number of frames
i.e. initial_frame = 1 , final_frame = 20 and increase the number to the total number we finally want.
Increasing the total frame number reduces the speed of an animation
decreasing speeds up the animation
Values for frame_number based animations:
frame_number ; The number of the actual frame to render!
This is useful, if we want to render a precise number of frames with fix steps between each frame.
i.e. with a LCD-counter or with frame by frame animated elements imported from other
3D programs like Poser.
initial_frame ; frist frame number to render
final_frame ; last frame number to render
clock_delta ; returns the amount of time between clock values in animations in POV-Ray.
clock_on ; with this boolean value the status of the clock can be checked: 1 is on, 0 is off.
|
sphere { <0,0,0>, 0.15
pigment{ color rgb<1,0,0>}
translate<1,0,0>
rotate<0,360*(clock+0.00),0>
} // end of sphere ---------
| |
Example rotation with clock
sphere { <0,0,0>, 0.15
pigment{ color rgb<1,0,0>}
translate<-1+3*clock,00>
} // end of sphere ----------
| |
Example translation with clock
text { ttf "arial.ttf",
str(frame_number,0,0),0.1,0
pigment{ color rgb<1,1,1> }
scale<1,2,1>*0.5
translate<-2.4,0.25,0.3>
} // end of text object ----------
| |
Example objects by frame_number
|
|