Home :: Login :: Forgot Password :: Search :: FAQ
Support our host

News

Software

Reference

Community

Parts Library

About Us

Reference > Tutorials
Published By OrionP on Thursday, February 19, 2004 - 02:12 AM

Printer-friendly page
Rotation Animation  
 
What is Rotation Animation TOP

Rotation animation is a term give to those animations that focus on moving objects in place. Example of this are wheels or gears turning or in our case a helicopter rotors. The process of rotation animation is similar to the simple movement animation we have discusses before in which we move the object to create the animation. In this tutorial, the object in question, a helicopter, will stay in place but its parts will move, the rotors.

This tutorial will show you how to make the animation seen in figure 1.

Figure 1: LEGO # 6685 Helicopter - Ready for Take Off
 
Requirements for Tutorials TOP
Knowledge: This tutorial deals with complex animation procedures and we recommend that prior to reading it you familiarize yourself with the basic of LDraw animation by reading the following tutorials.  

Software: Ensure that you have installed the following applications on your computer

  • LDraw
  • MLCad
  • L3P
  • POV-Ray v3.5

These application can be installed all at once with the LDraw-All-In-One Installer.

 

 
  • a video editing application that can import image files (Ulead Media Studio Pro, Macromedia Fireworks, etc.)
 

Files: Download the following files so that you may walk through the tutorial.

 
Step by Step TOP

In order to create the animation shown in figure 1, we need to determine first what will be moving. Any part that we need to animate must be an individual LDraw file. Doing this allows us to group parts together, define rotation points and most importantly, as you will see later, is name the parts.

Some of the figures in the steps below have been shrunk to give the reader a overall view of what is occurring. The symbol denotes a bigger image is available for download by clicking on the symbol.

 
Step 1

Download the files needed from the Requirements section and place then in your models folder of LDraw.

(Hint: Usually at C:\LDraw\Models\)
Step 2

Open 6685_rotorblade.ldr using MLCad. You should see something similar to figure 2.

Figure 2: Viewing 6685_rotorblade.ldr in MLCad

The file is made up of three parts: Propeller 4 blade (Part # 3461), 1x8 Plate (Part # 3460), and Technic Axle 2 (Part #3704). We want the rotor blade to rotate around the center hole of #3461 propeller 4 blade, so we need to place that hole at coordinates 0,0,0.

Step 3

Click on #3704 technic axle 2 place it at 0,0,0. One way of doing this is to right-click on your mouse (while the part is active) and choose the "Enter Pos. + Rot..." command, which will display a pop-up window shown in figure 3.

Figure 3: Changing coordinates of a part in MLCad

Replace the values in the X, Y, Z boxes with 0s.

Step 4

Now click on #3461 propeller blade 4 and move it so that the middle hole is directly above the #3704 technic axle 2.

(Hint: Move the #3460 1x8 plate out of the way to see your results.)
Step 5

Move, copy and rotate #3460 1x8 plate to make the four rotor blade. In the end you should end up with the model shown in figure 4.

(Hint: Set the grid to medium to line up the 1x8 plates correctly with the propeller blade 4)

Figure 4: Rotor blade with Technic Axle 2
Step 6 Delete the #3704 Technic Axle 2 as this part was just a reference part. Any part can be used as a reference part but locating "holes" the #3704 Technic Axle 2 is the easiest to use as a reference. Now save the file as 6885mainrotor.ldr and close MLCad.
Step 7

Open MLCad and click on the models category on the left hand side to see all the sub models of the helicopter and begin to drop and drag the sub-models to build the final model as shown in figure 5.

Figure 5: 6685 Fire Helicopter

Note: You must close and reopen MLCad to allow it the ability to refresh the models folder. Otherwise our newly created file (6685_mainrotor.ldr) would not have appeared.

Hint: When you place the 6685_mainrotor.ldr submodel on the body of the helicopter use toolbar menu items to see how it will rotate in the animation. Similarly use to see the rotation of the tail rotor. If they rotate "funny" then the point of rotation in each sub model file is wrong. Now would be the time to fix it!

 

Step 8 Save the file as 6685_firehelicopter.ldr and close MLCad.
Step 9 Use L3P/L3PAO to convert the 6685_firehelicopter.ldr to a POV-Ray file. The default L3PAO setting will work fine for our example.
Step 10

Open the newly created POV-Ray file (we called it 6685_firehelicopter.pov) and render by clicking on the run menu icon. You should get an image similar to figure 7.

Figure 7: 6685 Fire Helicopter rendered in POV-Ray (default L3P/L3PAO settings) 
Step 11

Scroll to the bottom of the file and we see (from bottom up) we see code for lights, camera, background, and floor. Next we see a line that looks like this:

object { _6685_firehelicopter_dot_ldr #if (version >= 3.1) material #else texture #end { Color7 } }

Hint: The code above appears on line 8902. At the very bottom of the POV-Ray window there is a window with a "L:". This informs you what line of code the cursor is at.

So what does line 8902 tell us? Well that is the final line of code that POV-Ray uses to render the entire model. All the lines above it are used to create individual parts for the model. So it takes eight thousand, nine hundred and two lines of code to make our 6685 Fire Helicopter!

Now look at the lines of code starting at 8893 that look like this:
object { _6685_body_dot_ldr matrix <0,0,1,0,1,0,-1,0,0,0,0,0> ...
object { _6685_canopy_dot_ldr matrix <0,0,1,0,1,0,-1,0,0,0,-108,-55> ...
object { _6685_pilot_dot_ldr matrix <1,0,0,0,1,0,0,0,1,0,-60,-30> ...
object { _6685_rotortail_dot_ldr matrix <0,0,-1,1,0,0,0,-1,0,45,-124,220> ...
object { _6685_mainrotor_dot_ldr matrix <1,0,0,0,1,0,0,0,1,2,-144,10> ...

Note: The lines of code had been truncated to only show the object name and matrix.

As you might have guessed each of these lines of code defines the sub-models we put together in MLCad. We only need to focus on the matrix coordinates for our animation. The code after the matrix is not important as it deals with the color of the sub-model. The matrix can be very intimidating but its easy to modify once we know what it tells us.

Let us concentrate on the main rotor object matrix.

  • The first 9 numbers orient the part (NEVER EVER CHANGE THESE)
  • The last 3 numbers tells POV-Ray where to place the object (MLCad's X,Y,Z coordinates in our case)

In our case we place the mainrotor.ldr at location 2, -144, 10 which is exactly what POV-Ray has! Don't believe us? Open MLCad and look at the "position values" for the mainrotor.ldr sub-model in the 6685_firehelicopter.ldr model.

Step 12

When POV-Ray rotates something it will rotate the object around the 0,0,0 coordinate. For this reason we had to draw our main rotor around the 0,0,0 axis. Since POV-Ray can only rotate an object around the 0,0,0 axis we need to have POV-Ray move the object back to it's original location after the rotation. Have we lost you yet?

Okay lets change the code for the mainrotor object from this:

object { _6685_mainrotor_dot_ldr matrix <1,0,0,0,1,0,0,0,1,2,-144,10> ... 

to this

object { _6685_mainrotor_dot_ldr matrix <1,0,0,0,1,0,0,0,1,0,0,0> translate <2,-144,10> ...

Note: POV-Ray is case sensitive so make sure your code looks EXACLTY like the code above.

Render the file and you will get the same image as in figure 7.

Step 13

Now add "rotate <45,0,0>" before the translate code we just added to make it look like this:

 

object { ... matrix <1,0,0,0,1,0,0,0,1,0,0,0> rotate <45,0,0> translate <2,-144,10> ...

and re-render the file. You should get an image like figure 8.

Figure 8: Rendering using Rotate <45,0,0> in object main rotor. 

The results are not exactly what we want for the animation but its all about trail and error. Try using rotate <0,45,0> and rotate <0,045> to see what type of results you get. One of them will rotate the main rotor alone the axis we want for the animation.

Hint: rotate <0,45,0> is the correct line of code for our animation. The keyword rotate and all other keywords in POV-Ray use the coordinates of <x,y,z>. Remember when you build the helicopter from all the sub-models and we told you to use the to rotate it? You were rotating the main rotors around the y-axis thus <0,45,0>.

Step 14 Now that we found out the correct axis for the main rotor we need to remove the 45 and add the keyword "clock". Clock is what POV-Ray uses as the keyword for animations.
Step 15

Repeat the same line of thinking for the tail motor. In the end you should end up with a line of code like this:

object { ... matrix <0,0,-1,1,0,0,0,-1,0,0,0,0> rotate <clock * 4,0,0> translate <45, -124, 220> ...

Note: In real life the tail rotor of a helicopter spins faster than the main. To show this we will make the tail spin 4 times faster and that is done by multiplying the clock by 4.

Step 16

Save your modified POV-Ray file as FH_Ani.pov and open up ani.ini. It will look this this:

; Animation INI File
Initial_Frame=1
Final_Frame= 30
;Subset_Start_Frame = 1
;Subset_End_Frame = 30
Initial_Clock=0
Final_Clock=360
Width=640
Height=480
Cyclic_Animation=on
Pause_when_Done=off
Output_File_Type=N 
; T - Uncompressed Tar 24-bit File
; N - New PNG (portable network graphics) format
; S - System-specific such as Mac Pict or Windows BMP
; C - Compressed Targa-24 format (RLE, run length encoded)
; P - Unix PPM format
Antialias=On
Antialias_Threshold=0.3 

Of interest to us are the number of frames (16 in this case) and the clock values (0 to 360). You can use any number of frames but anything under 15 and the human eye will notice that the animation is choppy and a series of images instead of smooth motion. Our choice of 30 is to follow the NTSC Video standards (i.e. US television, VCRs). Since we want to blades to rotate completely in a full circle they need to travel 360 degrees, thus the final clock value of 360 is used. Cyclic animation changes the clock value so when we repeat the animation there is no jump.

Click on the POV-Ray ini Menu icon to open the popup window in figure 9.

Figure 9: POV-Ray INI Window Settings

Use the browse button to locate the ani.ini file and click "Set but don't Render" button to close the window. Instead of using the default ini file (QUICKERS.INI) we will be using our own custom ini file for the animation as the default file does not have the clock value we need for the animation.

Step 17

Click on the FH_Ani.pov file to see the code again and click on the icon. Sit back and enjoy as POV-Ray creates 30 images for your animation. Each image will show the helicopter blades moving just a bit.

Hint: To speed up the process of rendering ensure you are not running any other applications and use a quality level = 2 in your FH_Ani.pov file (line 11).

Hint 2: Reducing frames.
Since there are four main rotor blades the the frames will repeat after they turn 90 degrees.
In the INI file change final frame to 4 and final clock to 90. We get the same results in only 4 frames.

Step 18 Congratulations we are done. Assemble the pictures into an avi, gif or a movie file of your choice. Last do not forget to post your new creation on the world wide web for all to see.
 
To see a wide range of rotation animations by Steve Krass please click here. TOP

Help Desk Tutorial: Animation: Rotation
Version 1.0 (20 Feb 04)
Created by Steve Krass
Edited by Ahui Herrera, LDraw Help Desk
http://www.ldraw.org/




Recipient 2007
Kevin Clague

Want to learn more about LDraw? Check out the following books:




Current Contest Winners

Model of the Month


Scene of the Month



Vote for Next Month's Winner

Submit Your Creation for Next Month's Contest

What's new in lugnet.cad?

Re: Looking for part - Hinge Arm 2x2x6
by Michael Heidemann - 36 minutes ago

Re: "LGEO" and "L3P v1.4 BETA 20080930"
by Jeff Boen - 19 hours ago

Re: Looking for part - Hinge Arm 2x2x6
by Dave Heintz - 19 hours ago

Introduction to LPub 4 video
by Jim DeVona - 20 hours ago


There are 88 unlogged users and 1 registered user online.

You can log-in or register for a user account here.





 


 Log in Problems?
 New User? Sign Up!

©2003-2008 LDraw.org, see Legal Info for details.
LDraw™ is a trademark owned and licensed by the Estate of James Jessiman
This website is powered by Peeron.com.

LEGO® is a registered trademark of the LEGO Group, which does not sponsor, endorse, or authorize this site. Visit the official Lego website at http://www.lego.com.
LDraw is a completely unofficial, community run free CAD system which represents official parts produced by the LEGO company.