Keep 3DLuVr online!
3DLuVr Logo
 From the Real World
 Digital Painting Series
 Featuring of...
 On the Bookshelf
 3ds max
 Softimage XSI
 Rhinoceros 3D
 Video Tutorials
FunZone menu
 I always wanted to be
 Talk to an employer
 Why Ask "Why"
TechZone menu
 Hardware Reviews
 Software Reviews
 Q&A, Tips & Tricks
UserZone menu
 The Artist Sites
 15 Min of Fame
 Request an Account
 Current Assignment
 Sponsors & Prizes
 Make a Submission
 Voting Booth
 Competition Rules
About menu
 Mission Statement
 Poll Archive
 How to IRC
Log in to be able to post comments to the news items, forum posts, and other facilities.
Not registered? Register!     Lost Password?
 Your New Year`s Resolution is...
Gain employment
Stop smoking/drinking/etc
Get back in shape
Find the meaning of life
Conquer the World
Absolutely nothing

    Poll Results
Want to leave us a comment about the site or in general? Click here to access the form.
ArtZone Heading
The Claw (Expressions)
Added on: Sat Jul 01 2000
Page: 1 2 3 

Now we have all the equations down we can FINALLY write the script. Which is basically already written above. To split the expression up in to sections we need to make a case for each section with "if" statements.
The "if" function follows this syntax "if(a,b,c)" which means in human terms "If a is true, then b, if a is false then c". It HAS to have all three parts or you will get a parsing error. So here is the expression: (cheer)
    if(ConPos.z-BallPos.z>21 , Closed ,
    if(ConPos.z-BallPos.z>14 & ConPos.z-BallPos.z<21 , degToRad((ConPos.z-BallPos.z-21)*5),
    if(ConPos.z-BallPos.z>7 & ConPos.z-BallPos.z<14 , degToRad((7-(ConPos.z-BallPos.z))*5),
If it is the first section (above 21 units) then the claw is closed, (remember the closed variable you made, here it is in action) but if the claw isn't abovet 21 units then....if it is above 14 units and below 21 units then open the claw from 0 to -35 degrees if it isn't in this "section" then if the claw is below 14 units and above 7 units then close from -35 to 0 degrees, and if the claw is below 7 units (and clipping with the ball) keep the claw closed anyway.

The only thing I didn't cover is the degToRad() function....since the Euler XYZ controller
works in radians and humans work in degrees this is a handy conversion function that has been built in.
Now Finger 2 should work properly. All that is left to do is to apply the same expression to the rest of the fingers. First apply expression controllers to the rest of the fingers. Note that two of the fingers rotate around the y-axis and two around the x-axis so apply the expression controller to the proper one. Finger 2 and Finger 3 should use the y-axis and Finger 1 and Finger 4 should use the x-axis.

Now close the window and move the shaft up and down. The claw should open/close around the ball.
� 1997-2024 3DLuVrTM (Three Dee Lover)
Best viewed in 1024x768 or higher,
using any modern CSS compliant browser.