## Maya Training

Introduction to Hard Surface Modeling

## Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

## Maya Training

Shading, Lighting and Rendering the Bedroom in MR

## Maya Training

Robot volume one - Modeling with animation in mind

## Maya Training

Spach-Alspaugh House the complete courseware

## Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

## New Maya Training

Batman by Jason Edwards
You are here > Home > SimplyMaya Community Forums

# Welcome to Simply Maya

 Simply Maya User Community - Maya Tutorials expression for oscilating movement
 Register FAQ Members List Calendar Mark Forums Read

 04-02-2004, 12:43 AM #1 danrocha Subscriber     Join Date: May 2003 Location: Campinas - SP - Brazil Posts: 30 Thanks: 0 Thanked 0 Times in 0 Posts expression for oscilating movement Hello I need an expression to make a ball go up and when it reaches a certain height, it kinda oscillates, as with those popping toy clowns coming out of boxes attached to a spring... I have tried several approaches but can't get this to work! I'll try to explain it more clearly: I have a ball. I want it to go UP (y axis only) in a accelerated movement, which begins really fast (like an explosion) and slows down abruptely at the end (as if it was attached to a spring); then it goes down a little, then up again, down again, etc, with its speed going down until it stops (or keeps oscillating real slowly).... Maybe it is too complicated, and I should try another way to do this? Please heeeeelp thanx a lot Daniel __________________ "The hardest thing to see is what is in front of your eyes" Goethe
 04-02-2004, 02:15 AM #2 kbrown Moderator     Join Date: Sep 2002 Location: London, UK Posts: 3,198 Thanks: 0 Thanked 8 Times in 8 Posts Keyframing gives you the best control. You could do it with an expression too but is it really worth it? Here's one possibility: Code: ```int \$iStartOsc = 6; float \$fHeightMult = 3; int \$iStopFrame = 75; if(frame < \$iStartOsc) nurbsSphere1.translateY = frame * \$fHeightMult; else if(frame < \$iStopFrame) nurbsSphere1.translateY += \$fHeightMult * sin(frame - \$iStartOsc) * ((\$iStopFrame - frame) / \$iStopFrame);``` __________________ Kari - My Website - My IMDB Do a lot, Fail a lot and Learn a lot!
 04-02-2004, 02:21 AM #3 mtmckinley The Maya Mountain     Join Date: Aug 2002 Location: Seattle, WA Posts: 8,245 Thanks: 1 Thanked 25 Times in 25 Posts you might could use a dynamic constraint with some gravity and initial movement and such. Check out the Dynamic Constraints tutorial we've got here for more info. __________________ -Mike www.mtmckinley.net The Maya Toolbelt
 04-02-2004, 10:07 AM #4 danrocha Subscriber     Join Date: May 2003 Location: Campinas - SP - Brazil Posts: 30 Thanks: 0 Thanked 0 Times in 0 Posts Thanx a lot... I've tried then to use a spring constraint, played around with its damping and stiffness attributes, and got pretty much the movement I needed. As I need lots of balls doing exactly the same movement, I'll try to duplicate them and to use diferent keys to control the activation of the constraint. I'll try to implement the code, anyway. See what works best Daniel __________________ "The hardest thing to see is what is in front of your eyes" Goethe

A little bit about who we are