Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 04-02-2004 , 01:43 AM
danrocha's Avatar
Subscriber
Join Date: May 2003
Location: Campinas - SP - Brazil
Posts: 30

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!
user added image

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? user added image

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>
# 2 04-02-2004 , 03:15 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
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!
# 3 04-02-2004 , 03:21 AM
mtmckinley's Avatar
The Maya Mountain
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
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.

# 4 04-02-2004 , 11:07 AM
danrocha's Avatar
Subscriber
Join Date: May 2003
Location: Campinas - SP - Brazil
Posts: 30
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 user added image

Daniel user added image


<font size="1"><strong>"The hardest thing to see is what is in front of your eyes"
<em>Goethe</em></strong></font>
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads