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)
| 43267 Views
| 0 Comments
| Comments 0
Date Added: 30th December 2010
Software used:
Maya

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).

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

1369_tid_figure24.jpg
Fig. 24

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

1369_tid_figure25.jpg
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>>;
 
Click Here To Download Code

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;
 
Click Here To Download Code

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

Click Here To Download Code

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


1369_tid_figure26.jpg
Fig. 26

Fig.27




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

Tutorial

Gallery Image.



Keywords: painting, planets, photoshop,

Go to tutorial
rating star nonerating star nonerating star nonerating star nonerating star none (0)
Comments 0 Views 70435

Tutorial

Gallery Image.



Keywords: 3ds max, water, animation, particles

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 6902

Tutorial

Gallery Image.



Keywords: explosion, smoke, particle, technique,

Go to galleries 1
rating star fullrating star fullrating star fullrating star halfrating star none
Comments 0 Views 121222

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 30758
Readers Comments (Newest on Top)
no comments!
No comments yet. Be the first to comment!
Add Your Comment