PDA

View Full Version : Expressions problem, I'm bad at code...


kyphur
10-07-2002, 03:45 AM
Hey, I'm trying to get some feathers to softly float to the ground. I'm using particles and instancing in some simple feathers from a surface emitter and letting them fall. I figured that if I could raise the PerParticle's center of rotation to like an inch above them I could just rotate along the x or z axis and it would look as if they're swaying back and forth on their way down. Does anyone know how to do this? If I highlight the particles and click insert I just get the pivot center's location for the group. Does any of you guys know how to move the pivot on a Per Particle basis or even if this is possible?

Kyph

kyphur
10-07-2002, 04:19 AM
I'm doing this all with expressions as part of an assignment for class. If anyone knows how to do this in any way what-so-ever I will be more than happy to listen.

Jason

kyphur
10-08-2002, 04:33 PM
I've gotten it to work but now all my expressions don't seem to want to work. The pivot is now about one unit above the feathers and I can't seem to get them to spin correctly or if they do they spin at 100 mile per hour and are almost indistinguisable. I put a command for time in there but I have to put it in there at 200000 in order for it to slow down to look semi right. Plus it jitters on more than one axis even though I'm only specifying one axis. I hate writing code, my mind doesn't work like this.

This is what I have so far, don't laugh too hard. :annoyed:

float $randfl_x = 0;
float $randfl_y = ;
float $randfl_z = 0;
float $negmov = -10;
float $posmov = 10;
float $randmov = $negmov + $posmov + $randfl_y * frame / 200000;
float $spin_x = $randmov;


particleShape2.rotate = $randmov;


here's a link to a playblast of the motion looking down from an aerial perspective.

www.kyphurland.com/movies/poopie.avi

Thanks,

Kyph

alexx
10-08-2002, 07:59 PM
hmm..

if you want a (more or less) regular forth and back movement i would suggest a sine movement..

to get that use the following style:
rotate? = sin(time/speed)*angle

like that you will get a back and forth movement..

if you add something like:
rotate? = sin(time*particleId/speed)*angle

you will get different rotations for all particles.

good luck

alexx

Stahlberg
10-09-2002, 10:34 AM
I always preferred modeling and keyframing to particles and procedurals, even to dynamics.
Why not model a few simple snowflakes, say 10 - 20 - having much more control over their look than with particles - then keyframe their motion, again having much more control.
Then group them, copy them say 3 - 10 times or more. Space these new groups out, then change them by tweaking scale and/or rotation.
All this could be done in less than half an hour. Tweaking it later isn't a big deal either.

(Math is simply not very good at describing nature, unless you go to a lot of trouble increasing the complexity. But, I know this was an assignment, just my 2 cents about it in general.)

Anyway, I think the snowflake's motion isn't so much like a feather or piece of paper, since it's usually thicker and smaller and more permeable to air. As was mentioned, it's probably more like a sine curve, in the X and Z directions (if it's falling along Y), with semi-random frequency and amplitude (within certain ranges). At the same time it's spinning in a semi-random fashion in the X and Z axis (with the pivot point in it's center).

kyphur
10-09-2002, 05:45 PM
Alexx== Thanks alot, I'll try it out in a minute and see what happens. If it works then I'll be your endentured servant for life. :p

Stahlberg== Yeah, it's for a class and if it wasn't I wouldn't have spent this long on it otherwise I would've just done it with keyframes kinda like you said. I'm making progress on it but it's extreeeeeeeemely slow progress though. Hopefully Alexx's suggestion will work and get me out of the point I'm stuck at.

alexx
10-09-2002, 07:07 PM
unfortunately (since i am a TD) i have to admit that steven is about 101% right..
sometimes doing it by hand is a zillion times faster than writing scripts and urging particles to do the right thing.. - and of course dealing with all the maya bugs in dynamics

but hey.. where is the fun then and the reason to hire ppl like me ;)

cheers

alexx

CGTalk Moderation
01-13-2006, 06:00 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.