'Maya'


'Creating Orbiting Planets with Maya's Particle Instancer'

by Johnny Z
 

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!




Texturing_Techniques


Johnny Z, Orbiting, Planets - final image
Fig.26

Fig.27

Page 6




 

 
 
 
 
 

 

s