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
                                                       
Coupling Rods
Cyclic animation with sine and cosine function.
           


pleuel
To rotate an object in a radius R
around the Center O =<0,0>
by an rotation angle A (in degrees),
we need to move it to <X,Y> with
X = R * cos( radians ( A ) );(green)
Y = R * sin ( radians ( A ) );(orange)
Note: In POV-Ray sin() and cos()
  need their arguments in radians!
pleuel
The relevant radius
is Rc = the radius
of the coupling point.

Coupling Rods - Connecting the driving wheels together.
Declaring and calculating the basic values:
#local Gauge_ = 1.435; // standard gauche
#local Wheel_R = 1.00/2; // wheel radius
#local Con_R  = 0.20;   // conjunction radius
#local Conjunction_Len = 1.20;
       // conjunction length = axis distance

#local Time = clock + 0.00;
#local Wheel_Angle = 360*1*Time; // rotation angel
#local Wheel_Circ = 2*pi*Wheel_R ;// wheel circumference
#local Wheel_Move  = Wheel_Circ*Wheel_Angle/360;

// Conjunction position relative to wheel center:
#local Con_Y = Con_R * sin( radians( Wheel_Angle ));
#local Con_X = Con_R * cos( radians( Wheel_Angle ));
Wheels and conjunction rod, we can use from macros defined in my railway system 'RW_System' According rails can be found in the rail track system 'RT_System'.
pleuel
    RW_Wheel_11
RW_Axix_11
    RW_Axix_11
RW_Coupling_Rod_00
RW_Coupling_Rod_00
RT_Track_Straight_00
RT_Track_Straight_00
2 Axes with wheels and concjunction rod:
//--------------------------------------------------------------//
#include "RW_System/RW_Axis_11.inc"
#local Axis =
object{ RW_Axis_11(
          2*Wheel_R, // wheel diameter, // in meter
          12,   // Number_Of_Spokes, //
          0.20, // Connector Radius // 0 or >wheel diameter/2
                // must be between:  < 0 and < 0.5 wheel diameter
          0.15, // counterweight depth, // 0=non, < wheel radius
          Gauge_, // gauge in meter
                  ) //------------------------------------------//
        rotate<0,0,Wheel_Angle>
      } //------------------------------------------------------//
#include "RW_System/RW_Coupling_Rod_00.inc"
#declare Coupling_Rod =
union{
 object{ RW_Coupling_Rod_00(
           Conjunction_Len,// coupling rod length x+(link to link)
           0.12, // rod height in y
           0.06, // depth in -z //
           0.09, // Rod_End_R // radius end links, >Rod_H/2 !
           1,    // Oil_Fillers_On // 0 = non, 1= On
          ) //-----
         scale <-1,1,1≶// mirrowed to x-
       }
 // coupling rod axes
 cylinder{<0,0,-0.05>,<0,0,0.05>,0.03 texture{ Rod_Metal_1} }
 cylinder{<0,0,-0.05>,<0,0,0.05>,0.03 texture{ Rod_Metal_1}
                            translate<-Conjunction_Len,0,0> }
} // end union Coupling_Rod ------------------------------------//
//--------------------------------------------------------------//
#include "RT_System/RT_Track_Straight_00.inc" //
#declare Rail_Spikes_On = 1; // optional, default = 0,
#declare Track =
object{ RT_Track_Straight_00(
            Wheel_Circ , // track length in x+ in meter
            2.00 , //  number of ties per meter; ~1.5
          ) //----------------------------------------
      } //------------------------------------------------------//
//--------------------------------------------------------------//

union{ // ---- 2 axes with connecting rods:
  object{ Axis translate<-Conjunction_Len,0,0>}
  object{ Axis translate<        0,0,0>}
  object{ Coupling_Rod translate<+Con_X,+Con_Y,-Gauge_/2-0.12>}
  object{ Coupling_Rod scale<1,1,-1>
                       translate<-Con_X,-Con_Y,+Gauge_/2+0.12>}
 translate<0,Wheel_R,0>
 translate<-Wheel_Move,0,0> // move it by clock to the right!
 translate<0,Height_Rail_Top,0> // lift it to rail top
} // end of union ----------------------------------------------//

union{ // ----- adding the rail tracks:
 #local Nr = -3;     // start
 #local EndNr = 4; // end
 #while (Nr < EndNr)
   object{ Track translate< Nr*Wheel_Circ,0,0 >}
 #local Nr = Nr + 1;  // next Nr
 #end // --------------- end of loop
} // end of union ----------------------------------------------//
//--------------------------------------------------------------//
// animated 'camera':
#declare Camera_Position = Camera_Position+<-Wheel_Move,0,0>;
#declare Camera_Look_At =  Camera_Look_At +<-Wheel_Move,0,0>;
//-----------------------------------------
camera{ location Camera_Position
        right    x*image_width/image_height
        angle    Camera_Angle
        look_at  Camera_Look_At
      } //------------------------------------------------------//
//--------------------------------------------------------------//
....

Coupling_Rod
  2 Axes with coupling rods.
coupling rods
Animated coupling rods on rail tracks.

Scene description
for POV-Ray:

"Coupling_Rod_tut_01_.ini" and
"Coupling_Rod_tut_01_.pov"
and the include files used here:
"RW_Wheel_11.inc",
"RW_Axis_11.inc",
"RW_Coupling_Rod_00.inc",
This scene needs the railtracks
from my include file set
Rail Track System for POV-Ray

Attention : We need to have the include files in the according subdirectories 'RT_System' and 'RT_System' somewhere in our include file path, as mentioned in the scene text above!
 
An example of an animation of this kind
you can find here: 3D-Animations - Railroad (Linked Axes).

top

© Friedrich A. Lohmüller, 2014
www.f-lohmueller.de