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

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 04-02-2004, 01:43 AM   #1
danrocha
Subscriber
 
danrocha's Avatar
 
Join Date: May 2003
Location: Campinas - SP - Brazil
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy 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
__________________
<font size="1"><strong>"The hardest thing to see is what is in front of your eyes"
<em>Goethe</em></strong></font>
danrocha is offline   Reply With Quote
Old 04-02-2004, 03:15 AM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 04-02-2004, 03:21 AM   #3
mtmckinley
The Maya Mountain
 
mtmckinley's Avatar
 
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
Thanks: 1
Thanked 25 Times in 25 Posts
Default

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
mtmckinley is offline   Reply With Quote
Old 04-02-2004, 11:07 AM   #4
danrocha
Subscriber
 
danrocha's Avatar
 
Join Date: May 2003
Location: Campinas - SP - Brazil
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

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
__________________
<font size="1"><strong>"The hardest thing to see is what is in front of your eyes"
<em>Goethe</em></strong></font>
danrocha is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.