Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
First ... 3 | 4 | 5 | 6 | 7 | 8 | 9
Modeling, Scripting and Animating Gears

| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star full
(46 Votes)
| 158869 Views
| 3 Comments
| Comments 3
Date Added: 7th May 2013
Software used:

Type the MELScript code into the Expression: field. Click Create to Compile and Save the expression (Fig.38).

If you have followed the tutorial correctly, you have finished. Play the animation and the gears should all by rotating and synced together.

1713_tid_fig38.png
Fig. 38

Error Checking

However, if you have made a typo in the MELScript and it produces an Error or incorrect results, you'll need to edit the expression. Open the Expression Editor (Fig.39).

1713_tid_fig39.png
Fig. 39

List the Expressions (Select Filter > By Expression Name). Then select gearRotation in the Selection listing (Fig.40).

1713_tid_fig40.png
Fig. 40


Finishing Touches

Up to now, the animation in this tutorial is very simple - gear01 rotates 10 times (3600°) over 20 seconds (500 frames).

Add some anticipation to the start and overlap to the end of the rotation for gear01 (Fig.41):

? Frame 1: Start Position: 0°
? Frame 25: Roll backwards to anticipate: -90°
? Frame 450: End of 10 rotations: 3600°
? Frame 500: Roll backwards to rest position: 3560°

1713_tid_fig41.png
Fig. 41

All Stop..!!

To help create the illusion of weight in the way the gears rotate, they should come to a complete start and stop at each key frame. Select gear_basic01, and in the Channel Box, select RotateX. Open the Graph Editor (Window > Animation Editors > Graph Editor).

Select all four keyframe markers (small black dots) and set the tangents to Flat Tangent. This will ensure the animation comes to a compete start and stop at each keyframe - indicating weight (Fig.42).

1713_tid_fig42.png
Fig. 42

Play the animation.

Door Driven

In the previous section of this tutorial, the gear01 was the driving force for the animation.
In the next section the project is reversed to make the door the driving force:

gear_basic05.rotateX= door.translateY/0.2618;
gear_basic04.rotateX= gear_basic05.rotateX*-3;
gear_basic03.rotateX= gear_basic04.rotateX*-1.5;
gear_basic02.rotateX= gear_basic03.rotateX*-4;
gear_basic01.rotateX= gear_basic02.rotateX*-2;

As explained previously, when gear05 is driving the door the translation of the door is calculated as:

door.translateY=gear05.rotateX*0.2618;

In Fig.43 the driver is reversed from [gear05 > door], to [door > gear05]. Therefore, the rotation of gear05 is calculated as door.translateY/0.2618;

The MELScript to rotate gear05 is:

gear_basic05.rotateX= door.translateY/0.2618;

1713_tid_fig43.png
Fig. 43

In Fig.44, cog30 is paired to cog10. When cog30 is rotated, cog10 will rotate at three times the speed.

This can be summarized as a ratio: cog30/cog10=3 (30/10=3). The MELScript to rotate gear04 by three times the rotation value of gear05, in the opposite direction is:

gear_basic04.rotateX= gear_basic05.rotateX*-3;

1713_tid_fig44.png
Fig. 44

In Fig.45, cog30 is paired to cog20. When cog30 is rotated, cog20 will rotate at 1.5 times the speed.
This can be summarized as a ratio: cog30/cog20=1.5 (30/20=1.5). The MELScript to rotate gear03 by 1.5 times the rotation value of gear04, in the opposite direction is:

gear_basic03.rotateX= gear_basic04.rotateX*-1.5;

1713_tid_fig45.png
Fig. 45

In Fig.46, cog40 is paired to cog10. When cog40 is rotated, cog10 will rotate at four times the speed. This can be summarized as a ratio: cog40/cog10=4 (40/10=4). The MELScript to rotate gear02 by four times the rotation value of gear03, in the opposite direction is:

gear_basic02.rotateX= gear_basic03.rotateX*-4;

1713_tid_fig46.png
Fig. 46

In Fig.47, cog20 is paired to cog10. When cog20 is rotated, cog10 will rotate at two times the speed. This can be summarized as a ratio: cog20/cog10=2 (20/10=2). The MELScript to rotate gear01 by 2 times the rotation value of gear02, in the opposite direction is:

gear_basic01.rotateX= gear_basic02.rotateX*-2;

1713_tid_fig47.png
Fig. 47

Good luck and enjoy.

1713_tid_zzz_chris_shaw.jpg




< previous page

 
First ... 3 | 4 | 5 | 6 | 7 | 8 | 9
Related Tutorials

Master modeling and meshes

by Henrique Naspolini
published on 2014-11-17

Keywords: Maya, ZBrush, Modeling, Character

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (16)
Comments 2 Views 38377

Character Production in 3ds Max - Chapter 01

by Rodrigue Pralier
published on 2014-08-22

Keywords: 3dsmax, poly modeling, character

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star none (5)
Comments 0 Views 20348

Modeling 3D clothes in Marvelous Designer

by JH Park
published on 2014-06-23

Keywords: Modeling, clothes, Marvelous Designer

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (35)
Comments 9 Views 110446

Making of 'Decepticon Truck Crawl'

by Kiel Figgins
published on 2014-03-31

Keywords: Animation, Rigging, Transformer, Decepticon, Modeling, Lighting

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star half (9)
Comments 1 Views 32741
Readers Comments (Newest on Top)
avatar
Riccardo on Tue, 02 July 2013 6:11pm
Thank you very much! Great tutorial!
avatar
SirFunk on Wed, 26 June 2013 11:15pm
Awesome, thank you man :)
avatar
Kumar Jeetu on Tue, 07 May 2013 10:58am
nice tutorial
Add Your Comment