falling paper question.

Moderators: Disciple, zlovatt

Post Reply
Chagall
Posts: 1
Joined: April 24th, 2007, 1:21 pm

Excuse my ignorance, I'm still new to this and reading every tutorial I can find.
I have plans for a project in which a picture fall into frame and lands on a flat surface, followed by another, and another.

malex has a wonderful expression to simulate falling leaves here
http://www.aenhancers.com/viewtopic.php?t=8

and (with a minor tweak) that simulates exactly what I want, however the picture never 'lands' it just falls through the bottom of the frame. My question is, how can I make the photo stop when it hits a certain position?

Again, I apologize for my ignorance and thank you in advance.
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

You need to define a floor somewhere as a numerical value, then interpolate the result. Change the code for position to something like that:

yVelocity = 200; //pixels per second
oscFreq = 1.5; //oscillations per second
oscDepth = 35; //oscillation depth (pixels)
drift = 25; // drift (wind?) (pixels per second: - = left, + = right)
floor=500; //position of floor from top

X=value[0] + oscDepth*Math.sin(oscFreq*Math.PI*2*time) + drift *time;
Y=easeIn(value[1]+yVelocity*time,value[1],floor)
Z=0;

[X,Y,Z]
[Pour Mylène, ange sur terre]
Post Reply