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
1 | 2 | 3 | 4 | 5 | 6
Creating Orbiting Planets with Maya's Particle Instancer

By Johnny Z
| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star full
(1 Votes)
| 41338 Views
| 0 Comments
| Comments 0
Date Added: 30th December 2010
Software used:
Maya

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

1369_tid_figure20.jpg
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) ;
            }
 

Click Here To Download Code

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) ;
            }
 

Click Here To Download Code


1369_tid_figure21.jpg
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))>>;

Click Here To Download Code

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.

1369_tid_figure22.jpg
Fig. 22





< previous page next page >
 
1 | 2 | 3 | 4 | 5 | 6
Related Tutorials

Tutorial

Gallery Image.



Keywords: explosion, smoke, particle, technique,

Go to tutorial
rating star fullrating star fullrating star fullrating star halfrating star none (12)
Comments 0 Views 117461

Tutorial

Gallery Image.



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

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star none
Comments 0 Views 28908

Tutorial

Gallery Image.



Keywords: fire, particle, photoshop,

Go to galleries 1
rating star nonerating star nonerating star nonerating star nonerating star none
Comments 0 Views 18655

Tutorial

Gallery Image.



Keywords: fire, blaze, particle, max,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 47623
Readers Comments (Newest on Top)
no comments!
No comments yet. Be the first to comment!
Add Your Comment