about us   links   contact contributors   

  

 

 Home

   Python Home

   UnEdited Material

   Assignments

   Python Gems
 
 
   
  
  
  Downloads
 Mel Basics Notes (.pdf)
 Mel Basics Notes/Proj Files (.zip)
  
    
  
  
  Tips and Tricks
  
    
  
  
  Announcements
  
    
  
  
  Reading List
       
  
    
  
  
  Math Revision



When a circle's diameter is 1 unit, its circumference is pi (∏) units.

Circumference = ∏ * diameter
Circumference = 2∏ * radius

∏ = 3.14159
     



sin(angle)=O/H
cos(angle)=A/H
tan(angle)=O/A
     



degrees=radians*(180/∏)
radian=degrees*(∏/180)
     


     

  
    

  Please leave all references to the author intact in all documentation and tutorials.  
 

Terms of Use

 

  
   Python Gems   

 

 

  Wheel Roll in Z axis
 
Type :  Expression
Description : A wheel rotates according the distance translated along a single axis.
Use :  Procedural Animation
Download : MAYA 2009 .ma file [click here]

//--------------------------------------------------
//
// Create a cylinder, rotate and position it on the floor.
// Delete the History and Freeze Transforms
// Group the cylinder.
//
// The Group can be animated using Translation Z and
// the wheel will Rotate automatically
//
//--------------------------------------------------

// declare and assign variables
float $PI = 3.1415;
float $wheelRadius = 10;

if(frame==1)
{
    // reset the wheel and global group back at the origin
    globalTransforms.translateZ=0;
    wheel.rotateX=0;
}
else
{
    // translate the global group
    globalTransforms.translateZ+=0.1;

    // rotate the wheel according to global group translateZ value
    wheel.rotateX=360*(globalTransforms.translateZ/
                                  (2*$PI*$wheelRadius));
}

 

  Wheel Roll back and forth
 
Type :  Expression
Description : A wheel rotates according the distance translated along a single axis.
Use :  Procedural/Mechanical Animation
Download : MAYA 2009 .ma file [click here]

//--------------------------------------------------
//
// Create a cylinder, rotate and position it on the floor.
// Delete the History and Freeze Transforms
// Group the cylinder.
//
// The Group can be animated using Translation Z and
// the wheel will Rotate automatically
//
//--------------------------------------------------

    // declare and assign variables
    float $PI = 3.1415;
    float $wheelRadius = 10;
    float $frequency = 2; // speed
    float $magnitude = 7; // value

if(frame==1)
{
    // reset the wheel and global group back at the origin
    globalTransforms.translateZ=0;
    wheel.rotateX=0;
}
else
{
    // translate the global group
    globalTransforms.translateZ=
               (sin(deg_to_rad((frame)*$frequency)))*$magnitude;

    // rotate the wheel according to global
    // group translateZ value
    wheel.rotateX=360*(globalTransforms.translateZ/
                                    (2 * $PI * $wheelRadius));
}


 

  Turbulence (Random Vibrations)
 
Type :  Expression
Description : Add some random turbulence to an Object. The main object is Grouped and a local turbulence Expression is applied. This Group is then Grouped again to allow GlobalTransforms or even a Motion Path.

This Expression has interesting possibilities when considered for other Attributes than Translation and Rotation.
eg. Light Intensity, Colour, Bump Depth

Use :  Procedural Animation. Objects, Cameras. Lights
Download : MAYA 2009 .ma file [click here]

 

 

 

 

 

 

 

 

 

 

 

      

copyright FridgeMonsters.com
all rights reserved forever!!