### Keep up-to-date with Free tutorials!!

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

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Modeling, Scripting and Animating Gears

(Score 4.85 out of 5 after 46 Votes)
| 235371 Views
| 3
Software used:
Keywords:

You're now ready to start animating.

## Animating the Gears

The objective of this tutorial is to create a simple Gear system that is simple to animate and easily modified. It would be far too tedious and time consuming to keyframe the rotation of gear01 - gear05 + TranslateY of door. It would be even more tedious to modify it several times if your supervisor required it.

For that reason, we'll create a system that only requires the animator (you) to animate gear01.
Select gear01 and create the following 2 keyframes (Fig.30).

Fig. 30

Play the animation and check that gear01 rotates 10 times.

## Creating the MELScript

MELScript is the programming language used in Maya. An expression is a MELScript that runs every frame and allows you to create animation.

The next step is to write a MELScript that calculates the rotation value for each gear (gear[2] - gear[5]). We'll start by creating and explaining the MELScript first, and then show you how to use the Expression Editor later in the tutorial.

## MELScript for gear02

In Fig.31, cog10 is paired to cog20. When cog10 is rotated, cog20 will rotate at 1/2 the speed.

Fig. 31

This can be summarized as a ratio: cog10/cog20=0.5 (10/20=0.5). The MELScript to rotate gear02 by 1/2 the rotation value of gear01, in the opposite direction is:

gear02.rotateX=gear01.rotateX*-0.5;

## MELScript for gear03

In Fig.32, cog10 is paired to cog40. When cog10 is rotated, cog40 will rotate at 1/4 the speed.

Fig. 32

This can be summarized as a ratio: cog10/cog40=0.25 (10/40=0.25). The MELScript to rotate gear03 by 1/4 the rotation value of gear02, in the opposite direction is:

gear03.rotateX=gear02.rotateX*-0.25;

## MELScript for gear04

In Fig.33, cog20 is paired to cog30. When cog20 is rotated, cog30 will rotate at 2/3 the speed.

Fig. 33

This can be summarized as a ratio: cog20/cog30=0.66 (20/30=0.66). The MELScript to rotate gear04 by 2/3 the rotation value of gear03, in the opposite direction is:

gear04.rotateX=gear03.rotateX*-0.66;

## MELScript for gear05

In Fig.34, cog10 is paired to cog30. When cog10 is rotated, cog30 will rotate at 1/3 the speed.

Fig. 34

## < previous page continued on next page >

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Related Tutorials

3D LOD Subdivision - 3ds Max Tutorial

by Tiago Mederios
published on 2011-04-26

Keywords: 3ds max, modeling, subdivision,

(26)
5 138777

Facial Modeling - Video Tutorials

by Michael Bauer
published on 2009-12-09

Keywords: facial, modeling, video, max,

(7)
3 35084

Basic Modelling Techniques in 3ds Max

by Michael Bauer
published on 2009-12-09

Keywords: modeling, beginner, max, object,

(31)
9 156347

Joan of Arc: Bust Armour

by Michel Roger
published on 2009-12-17

Keywords: character, modeling, joan, arc,

(6)
0 79429