### 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

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

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

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

gear05.rotateX=gear04.rotateX*-0.33;

So here's the MELScript so far:

gear02.rotateX=gear01.rotateX*-0.5;
gear03.rotateX=gear02.rotateX*-0.25;
gear04.rotateX=gear03.rotateX*-0.66;
gear05.rotateX=gear04.rotateX*-0.33;

Finally, the difficult part - gear05 lifting the door.

gear05 contains a single cog30. For each degree cog30 rotates, the door will translate in the Y axis. If we calculate the circumference of cog30 and divide by 360°, we'll know how much to translate the door in the Y axis.

Here's a quick breakdown of this process (Fig.35):

1. Rotating cog30 360° will translate door the same distance as the circumference of cog30.
2. Therefore, we can assume that by rotating cog30 1°, door will translate circumference/360.

The circumference of a circle is calculated as: 2? * radius

Where ? (Pi) = 3.14159, the circumference of cog30 is:

= (2*3.14159)*15
= 94.248

Therefore, rotating gear05 by 1° will translate door:

= 94.248/360°
= 0.2618

Rotating gear05 by 90° will translate door:

=90*0.2618

Fig. 35

The MELScript to translateY door, based on the rotation of gear05 is (Fig.36):

door.translateY=gear05.rotateX*0.2618;

So, the completed MELScript is:

gear02.rotateX=gear01.rotateX*-0.5;
gear03.rotateX=gear02.rotateX*-0.25;
gear04.rotateX=gear03.rotateX*-0.66;
gear05.rotateX=gear04.rotateX*-0.33;
door.translateY=gear05.rotateX*0.2618;

## Creating an Expression

Now that we've written the MELScript, the next step is to use it to create an expression.

Fig. 36

Open the Expression Editor (Window > Animation Editors > Expression Editor)(Fig.37).

Enter the name "gearRotation" into the Expression Name field.

Fig. 37

## < previous page continued on next page >

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

'The Box'

by Aleksander Magnussen
published on 2009-12-09

Keywords: box, modeling, animation, max,

(3)
1 24097

Making and Preparing a Rock Arch for a Game Engine: Part Two

by Dimitar Tzvetanov
published on 2010-03-10

Keywords: scene, rock, arch, game, modeling,

(2)
0 41606

Maya modeling: Modeling the torso

by Jahirul Amin
published on 2013-08-22

Keywords: character, human, torso, modeling,

(43)
5 155335

Sci-fi cars in 3ds Max: Desert Racer Part 1

by Andrew Finch
published on 2017-02-08

Keywords: race car, car, 3ds Max, modeling, Andrew Finch, desert

(3)
0 4964