PDA

View Full Version : Falling Leaves simulation

 Fess01-02-2007, 04:02 AMHello everyone.. I applied a leaf.tif with a alpha channel to a NURBS plane. I then instanced the plane to my particles. My problem is the leaves exit the emitter & fall perfectly flat through time. I'd like the plane(leaves) to wabble & spin like a real leaf as they exit the emitter. How can I accomplish this? Appreicate and HELP! Thanks Fess
sacslacker
01-02-2007, 05:02 AM
You could add a turbulence field to them. I guess it depends on how realistic you want things.

baran
01-02-2007, 09:58 AM
U can add a random rotation for the planes. Also try with some conserve and turbulance. this will give a nice stay for a moment and then pickup the speed of the flow.

Fess
01-02-2007, 02:57 PM
Hey sacslacker, baran

Thanks for the info, I'll give it a shot. :beer:

-Fess

Ge-ZUS
01-03-2007, 04:29 PM
If you want the leaves to be able spin on every axis, try to write a runtime expression that contains a randomizing vector that changes very slowly

ie:

rotateX = rand(<<-1,-1,-1>>,<<1,1,1>>);
rotateY = rand(<<-1,-1,-1>>,<<1,1,1>>);
rotateZ = rand(<<-1,-1,-1>>,<<1,1,1>>);

actually, the problem with my expression is, that the vector would change waaaay too sudden (value and direction) :-(

but look at it as a hint ;-)

---> but i'm gonna have a look at it at home...bb

plug3
01-03-2007, 06:19 PM
To get smooth rotation increment the rotation on each axis by a small random number:
rotX = rotX + randomNumber

And to get more realistic increase it depending on the velocity
rotX = rotX + (randomNumber*velocityFactor)

5parts
01-03-2007, 07:24 PM
To get smooth rotation increment the rotation on each axis by a small random number:
rotX = rotX + randomNumber

And to get more realistic increase it depending on the velocity
rotX = rotX + (randomNumber*velocityFactor)

So whats velocityFactor? did i just miss it as an attribute you have to add, or is it a custom attribute which, at runtime, calculates the mag (partShape.velocity)? Or am i totally off here?

plug3
01-04-2007, 07:26 PM
So whats velocityFactor? did i just miss it as an attribute you have to add, or is it a custom attribute which, at runtime, calculates the mag (partShape.velocity)? Or am i totally off here?

You're right it's an added attribute (float) I was just writting 'pseudo' code.

in mel the runtime expression is:
leafParticlesShape.velocityFactor = (mag(leafParticlesShape.velocity)/10);

In the project I did I only used this velocityFactor to increment the rotation (no random number) and got a nice rotation motion.

Fess
01-08-2007, 08:41 PM

To add rotation to the instanced particles here's what I did:
1. select the particles
2. attribute editor>particleShape>Instancer (Geometry Replacemet)>Rotations Options>Rotation
-set to "Velocity" will give a very fast rotation
-set to "WorldVelocity" will give a very natural relaxed rotation

playblast (http://www.mohan-conceptual.com/maya/leaves_final.mpg) (using WorldVelocity)

_d1

the "velocityFactor" is a added attribute from the particleShape1>Add Dynamic Attributes>General>Particle Tab?
I could not find that attribute.....

Thanks
-F

Aikiman
01-08-2007, 08:58 PM
heres a good leaf tut..

http://www.learningmaya.com/t_leaves.php

Fess
01-09-2007, 04:00 PM
Aikiman,

That was just the right tutorial. Thanks buddy :thumbsup:

-Fess

plug3
01-09-2007, 07:44 PM

To add rotation to the instanced particles here's what I did:
1. select the particles
2. attribute editor>particleShape>Instancer (Geometry Replacemet)>Rotations Options>Rotation
-set to "Velocity" will give a very fast rotation
-set to "WorldVelocity" will give a very natural relaxed rotation

playblast (http://www.mohan-conceptual.com/maya/leaves_final.mpg) (using WorldVelocity)

_d1

the "velocityFactor" is a added attribute from the particleShape1>Add Dynamic Attributes>General>Particle Tab?
I could not find that attribute.....

Thanks
-F

Yes it is an added attribute but you define it. Like in the tutorial Aikiman posted. Except it would be a float instead of vector.
The animation looks good. You should add a turbulence field, it does wonder and you don't need any scripting.

HowardM
01-10-2007, 11:14 AM
You could also try softbodies if you want them to actually bend and curl :)

cheers

Fess
01-11-2007, 03:48 PM
_d1Yeah I agree about the turb fields, just found the trick of using 2 turb fields with slightly different mag & phaseY settings will cause them to battle and produce some interesting effects.

Howard, great link buddy. I'll definately look into it.

Thanks
-Fess

Fess
01-16-2007, 02:35 AM
Hey guys,

I was reading about particle looping. The instructions were to select your particles on the last frame of the sequence & choose Solvers>Initial State>Set for Selected. Now the first & last frames will match.

I tried it with my leaves but when I loop the animation, its not seamless. :banghead:
I also tried it was simple particles and its not seamless.

I did a search but the threads are the same as the instructions i read
http://forums.cgsociety.org/search.php?searchid=4866190

Can anyone do a simple demo or perhaps point a tutorial out cause it seems so simple but I'm not able to do it....fustrating.

Thanks
Fess

Aikiman
01-16-2007, 02:50 AM
yeah Fess, I went to your link and tried Alexx recommendation as follows...

-define the time you want them to cycle (e.g. 100 frames (pal 25fps))
-set the lifespan to "constant" and for the time set 100frames (=4 sec in this case)
-play the simulation to frame 100 and stop there.
-"set initial state" for the particle system

Im pretty sure that this is working for me, have a go

Aikiman
01-16-2007, 10:43 PM
okay sorry, its not working for me.

Fess
01-18-2007, 01:38 AM
okay sorry, its not working for me.

:)
I'll have some time tomorrow to play with it & problem solve this cause its annoying me.

baran
01-23-2007, 09:36 AM
here is the simple scene with particle looping.

Fess
01-23-2007, 03:38 PM
here is the simple scene with particle looping.

Thank you my friend...:beer:

I have looping particles now....

What I did:

-create a emitter.
-define the time you want them to cycle (e.g. Using (NTSC 30 fps) 120 frames equals 4 seconds of play). Go to Windows>Settings/Preferences>Settings
Time: NTSC (30 fps)

Go to Windows>Settings/Preferences>Timeline
Playback Start/End: 1.00 120.00 (remember this is 4 seconds of play)
Playback Speed: Play every frame

-go to Attribute Editor>particleShape1>Lifespan Attributes:
Lifespan Mode: Constant
Lifespan: 4 (4 seconds equals 120 frames @ NTSC 30 fps)

-play the simulation to frame 120 and stop there.
-select your particles, go to Solvers>Initial State>Set for Selected.

Fess

CGTalk Moderation
01-23-2007, 03:38 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.