Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
logo
    3D Animations with POV-Ray
        Some basics and examples on animations.
Italiano Italiano
Français français
Deutsch Deutsch
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
                                                       

Animated Hands of a Clock  
The hands of a clock are rotating with different speed.
Cyclic animation of the hands of a clockface.


The Rotations of the Hands of a Clock:
While the hour hand turns 360 degrees just once in 12 hours the minute hand has to turn 12 times more = 360*12 degrees. And again the second hand has to turn another 60 times more = 360*12*60 degrees.
We declare a basic time variable Clock_Time where we can add test values between 0 and 1.
#declare Clock_Time = clock+0.00;
// rotation angles in degrees -------------
#declare Rotate_H   = Clock_Time*360;
#declare Rotate_Min = Clock_Time*360*12;
#declare Rotate_Sec = Clock_Time*360*12*60
Accordingly to test a specified time like
  '2h 20min 30sec' we have to declare:
#declare Clock_Time =
 clock + 2/12 + 20/(720) + 30/(43200);
For a cyclic animation of a 12 hours turn of a clock we should take into account that 12 h = 720 min = 43200 seconds!
So for a small sized cyclic animation it's better not to use the seconds hand. To see the correct running of the seconds hand during a 12 hours turn we need an animation with 43200 frames!

The Jumping of the Minutes and the Seconds:
If we want the hands for minutes and seconds to jump only to full minutes and seconds (each 6 degrees) we should add:
#declare Rotate_Min=int(Rotate_Min/6+0.01)*6;
#declare Rotate_Sec=int(Rotate_Sec/6+0.01)*6;

The Hands of a Clock:
To make the look of the clockface size independent we relate all element sizes to the basic clockface radius:
#declare CR = 0.400; // Clockface radius
// flatten cylinders we use here;
#declare Flat = &l;1,1,0.025>;
//-----------------------------------
#declare Face_D = 0.001;
// length of hands -------------
#declare Hd_H_Len   = CR*0.60;
#declare Hd_Min_Len = CR*0.85;
#declare Hd_Sec_Len = CR*0.95;
// radii of the hands ---------
#declare Hd_H_D   = CR*0.055;
#declare Hd_Min_D = CR*0.035;
#declare Hd_Sec_D = CR*0.020;
// position z of hands --------
#declare Hd_H_Z   = CR*0.05;
#declare Hd_Min_Z = CR*0.04;
#declare Hd_Sec_Z = CR*0.03;
//-----------------------------------------
For the hands and marks we use flat cylinders.
// hour hand --------------------
cylinder{ <0,0,0>,<0,Hd_H_Len,0>,Hd_H_D
          scale Flat
          rotate <0,0,-Rotate_H>
          translate<0,0,-Hd_H_Z>
          texture{ Hands_Texture } }
// minute hand ------------------
cylinder{ <0,0,0>,<0,Hd_Min_Len,0>,Hd_Min_D
          scale Flat
          rotate <0,0,-Rotate_Min>
          translate<0,0,-Hd_Min_Z>
          texture{ Hands_Texture }  }
// body center ----------------------------
cylinder{ <0,0,-Hd_H_Z>,<0,0,0>,Hd_H_D*1.5
          texture{ Hands_Texture } }
// face base ------------------------------
cylinder{ <0,0,0>,<0,0, Face_D>,CR
          texture{ Face_Texture } }
//-----------------------------------------
For more details of the clockface and the seconds hand and textures see the according scene file.

Clockface
Clockface: the arms.
Clockface
Clockface: The marks for hours and minutes.
Clockface
Clockface complete.
Clockface animation Clockface animation
Clockface animations.
Scene description for POV-Ray:
"Clockface_00.ini" and
"Clockface_00.pov"

station clock
A clock for a railway station
Some examples of use:



Alarm clock
An alarm clock

top

© Friedrich A. Lohmüller, 2008
http://www.f-lohmueller.de