PDA

View Full Version : Check for future collisions


X-PanDer
01-05-2010, 09:46 AM
Hi.

I am trying to create a flow that will spawn autumn leaves and letting them fall towards the ground.
As they hit the ground they must be rotated correctly and land on the flat side.

The thing is I have a scene with curbs and perhaps other obstacles, which the leaves must collide with and maybe land on.

So the function I'm really missing is the ability to check for future collisions and backtrack like 15 frames and then initialize the rotation so that it lands correctly.

I have just started developing scripts in particle flow, so that may be a solution too.

Does anyone know about a solution like the one I described or another way around?

Thanks in advance.

ivanisavich
01-05-2010, 09:52 AM
Add a collision event. Set the collision type to "will collide in..." and set the frame number to 15. Then send the particles that will collide in 15 frames to an event with a goto rotation operator in it, with the goto rotation set to 15 frames and the rotation type to random horizontal :)

ivanisavich
01-05-2010, 10:09 AM
Here's a sample file (you'll need max 2009 or higher to open it):

http://www.tysonibele.com/leaves.max

Here's a video of the animation:

http://www.tysonibele.com/leavesLg_Prog.mov

Here's the pflow layout:

http://www.tysonibele.com/leaves.jpg

X-PanDer
01-05-2010, 10:16 AM
Wow thank you very much. Will try that in just a moment. :)

X-PanDer
01-05-2010, 11:29 AM
Perfect. The thing I needed was the Will Collide in #frames.

Thank you very much! Nice quick work. ;)

X-PanDer
01-05-2010, 12:35 PM
Although there is one thing.

Is there any solution to the orientation problem if a leaf lands on the curb on a curved side? As it is now, the leaves will only rotate on the z axis which is great. But they will also be rotated only on the z axis and nothing else.

Is there a way to orient them by calculating the normal of the surface it collides with?

Thanks again. :)

3DMadness
01-06-2010, 02:55 PM
You can use a very slow speed by surface and use the rotation with speed space.

CGTalk Moderation
01-06-2010, 02:55 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.