### 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
Creating Orbiting Planets with Maya's Particle Instancer

(Score 4.67 out of 5 after 3 Votes)
| 70017 Views
| 0
Software used:
Keywords:

Jupiter will now follow an orbit like this (Fig.20).

Fig. 20

Getting the moons to orbit Jupiter is relativity simple. We will assign the next particle its own vector variable and tell Maya to add the new variable to Jupiter's variable, which will get the particle to orbit Jupiter. We know that Jupiter's radius is 11.2 and Io's radius is .28 so the distance value in our expression (as illustrated in Fig.19) needs to be greater than 11.48. Any smaller and the planets will collide. The speed attribute needs to be faster too or Jupiter will always be between Io and the Sun. Our new expression should look like this:

Â
vector \$sun_position = <<0,0,0>>;
vector \$jupiter_position = <<100*(sin(time)),0,150*(cos(time))>>;
vector \$io_position = <<20*(sin(time*5)),0,25*(cos(time*5))>>;
Â
if (particleShape1.particleId == 0)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = \$sun_position;
Â Â Â Â Â Â  Â Â Â Â  }
Â
if (particleShape1.particleId == 1)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = \$jupiter_position;
Â Â Â Â Â Â  Â Â Â Â  }
Â
if (particleShape1.particleId == 2)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = (\$jupiter_position + \$io_position) ;
Â Â Â Â Â Â  Â Â Â Â  }
Â

You should now be able to assign variables and "if" statements for the remaining 3 moons to get an expression similar to:

Â
vector \$sun_position = <<0,0,0>>;
vector \$jupiter_position = <<100*(sin(time)),0,150*(cos(time))>>;
vector \$io_position = <<20*(sin(time*8)),0,25*(cos(time*8))>>;
vector \$europa_position = <<30*(sin(time*6)),0,30*(cos(time*6))>>;
vector \$ganymede_position = <<40*(sin(time*4)),0,40*(cos(time*4))>>;
vector \$callisto_position = <<50*(sin(time*2)),0,50*(cos(time*2))>>;
Â
if (particleShape1.particleId == 0)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = \$sun_position;
Â Â Â Â Â Â  Â Â Â Â  }
Â
if (particleShape1.particleId == 1)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = \$jupiter_position;
Â Â Â Â Â Â  Â Â Â Â  }
Â
if (particleShape1.particleId == 2)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = (\$jupiter_position + \$io_position) ;
Â Â Â Â Â Â  Â Â Â Â  }
Â
if (particleShape1.particleId == 3)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = (\$jupiter_position + \$europa_position) ;
Â Â Â Â Â Â  Â Â Â Â  }
if (particleShape1.particleId == 4)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = (\$jupiter_position + \$ganymede_position) ;
Â Â Â Â Â Â  Â Â Â Â  }
if (particleShape1.particleId == 5)
Â Â Â Â Â Â  Â Â Â Â  {
Â Â Â Â Â Â Â Â Â Â Â Â Â  particleShape1.position = (\$jupiter_position + \$callisto_position) ;
Â Â Â Â Â Â  Â Â Â Â  }
Â

Fig. 21

If you hit play and let it go for several hundred frames you might notice the moons align every so often (Fig.21). As this most likely never happens in nature, we can go back in to our variable and add an offset value to make sure it doesn't happen. Change the moon variable to read:

Â
vector \$io_position = <<20*(sin((time+8)*8)),0,25*(cos((time+8)*8))>>;
vector \$europa_position = <<30*(sin((time+6)*6)),0,30*(cos((time+6)*6))>>;
vector \$ganymede_position = <<40*(sin((time+4)*4)),0,40*(cos((time+4)*4))>>;
vector \$callisto_position = <<50*(sin((time+3)*2)),0,50*(cos((time+3)*2))>>;

Now at the same frame, the planets are no longer aligned (Fig.22). Let's also add variables to handle the tilt and rotation of Jupiter and its moons.

Fig. 22

## < previous page continued on next page >

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

Fluid Particle tutorial

by Kashif Riley
published on 2009-12-09

Keywords: fluid, particle, softimage, xsi,

(0)
0 59041

Fireworks

published on 2009-12-09

Keywords: fireworks, max, particle, flow,

(4)
2 38087

Distribute Objects on a Surface Using Particle Flow

by Roberth Vala
published on 2011-08-22

Keywords: distribute, objects, particle, flow, max, video,

(0)
0 7016

'I Have to Plant a Hell of a Lot of XYZ'

by Anselm v. Seherr-Thoß aka PsychoSilence
published on 2009-06-16