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

1 | 2 | 3 | 4 | 5 | 6
Creating Orbiting Planets with Maya's Particle Instancer

By Johnny Z
| 58142 Views
| 0
Date Added: 30th December 2010
Software used:

In order to do this we will have to add a custom attribute to particleShape1 and then tell the instancer to use this attribute for rotation. Select particleShape1 and in the attribute editor under Add Dynamic Attributes click the General button (Fig.23).

Fig. 23

In the new tab type "custom_rotation" under Long name. Change Data Type to vector and Attribute Type to per particle (array) and click ok (Fig.24).

Fig. 24

In the instancer section, under Rotation Options, change Rotation to custom_rotation (Fig.25).

Fig. 25

Jupiter's axial tilt is 3.13 degrees and the planet rotates on that axis once every 10 hours. Working on the scale of Earth where Earth's rotation would simply equal "time", Jupiter's rotation variable will look like this:

vector \$jupiter_rotation = <<0,(time/0.416),3.13>>;

Place this under the \$jupiter_position variable in the expression editor to keep things organized.

Now within the curly braces "{}" of jupiter's "if" statement, type:

particleShape1.custom_rotation = \$jupiter_rotation;

With a little research we find that:

• Io's tilt is 2.21 degrees and it rotates every 42 hrs
• Europa's tilt is 0.47 and it rotates every 85.2 hrs
• Ganymede's tilt is 0.195 and it rotates every 171.6 hrs
• Callisto's tilt is 0.281 and it rotates every 400.536 hrs

This brings our final expression to look like this:

vector \$sun_position = <<0,0,0>>;

vector \$jupiter_position = <<100*(sin(time)),0,150*(cos(time))>>;
vector \$jupiter_rotation = <<0,(time/0.416),3.13>>;

vector \$io_position = <<20*(sin((time+8)*8)),0,25*(cos((time+8)*8))>>;
vector \$io_rotation = <<0,(time/1.75),2.21>>;

vector \$europa_position = <<30*(sin((time+6)*6)),0,30*(cos((time+6)*6))>>;
vector \$europa_rotation = <<0,(time/3.55),0.47>>;

vector \$ganymede_position = <<40*(sin((time+4)*4)),0,40*(cos((time+4)*4))>>;
vector \$ganymede_rotation = <<0,(time/7.15),0.195>>;

vector \$callisto_position = <<50*(sin((time+3)*2)),0,50*(cos((time+3)*2))>>;
vector \$callisto_rotation = <<0,(time/16.698),1.281>>;

if (particleShape1.particleId == 0)
{
particleShape1.position = \$sun_position;
}

if (particleShape1.particleId == 1)
{
particleShape1.position = \$jupiter_position;
particleShape1.custom_rotation = \$jupiter_rotation;
}

if (particleShape1.particleId == 2)
{
particleShape1.position = (\$jupiter_position + \$io_position) ;
particleShape1.custom_rotation = \$io_rotation;
}

if (particleShape1.particleId == 3)
{
particleShape1.position = (\$jupiter_position + \$europa_position) ;
particleShape1.custom_rotation = \$europa_rotation;
}
if (particleShape1.particleId == 4)
{
particleShape1.position = (\$jupiter_position + \$ganymede_position) ;
particleShape1.custom_rotation = \$ganymede_rotation;
}
if (particleShape1.particleId == 5)
{
particleShape1.position = (\$jupiter_position + \$callisto_position) ;
particleShape1.custom_rotation = \$callisto_rotation;
}

And our final result to look something like Fig.26 & Fig.27!

Fig. 26

Fig.27

< previous page

1 | 2 | 3 | 4 | 5 | 6
Related Tutorials

Tutorial

Painting Planets

Keywords: painting, planets, photoshop,

(14)
9 97903

Tutorial

FX Particles and Dynamics in Maya

Keywords: maya, water, particles, dynamic

0 9039

Tutorial

Maya Irradiance Particles in Mental Ray - Video Tutorial

Keywords: maya, mental ray, rendering, irradiance, particles,

0 43739

Tutorial

Using a Particle System to Create Foliage

Keywords: particle, system, foliage, max,

0 14881