View Full Version : getting particles to stay on top of surface
10-09-2003, 12:27 AM
im makeing a stream that is flowing down a mountainside, using make collide. it starts off ok, but about 1/3 of the way down i have an area where it cuts back on itself a bit, and at that point the particles start to go under the surface, only to reappear further down the mountain side
anyone know how to fix this, ive tried setting the resiliance on the mountain object up a bit, but if i set it to high, they start flying off the surface.
pic of problemfrom the front (http://userweb.suscom.net/~eric81/problem1.jpg)
From Side (http://userweb.suscom.net/~eric81/problemUnder.jpg)
Thanks in Advance
10-09-2003, 01:04 AM
umm, can't be sure from just the pics, but it doesn't look like your collisions are working at all. Go into the dynamic relationship editor (windows>relationship editors>dynamic) and make sure the particles(left pane) are connected to the geometery(right pane, under collisions button).
If they are connected and its not working, try adding some more edges in the problem area (try poly>smooth for a quick test). sometimes there are not enough verts to collide with.
10-09-2003, 03:07 AM
would surface flow do the trick? it would save memory, and you could direct them where you want. Haven't used it much at all...that is to say you using nurbs, if not you could create a nurbs path similar to the mountain side for it.
10-09-2003, 04:15 AM
You might try shaping a nurbs plane to outline the way the stream is supposed to flow down the mountain. Then emit from the surface. Add need parent UV and write an expression on the goal weights to control how the particles flow down the mountain along the surface. You can even apply dynamic effects like turbulence on top of the expressions. Let me know if you need clarification of this idea.
10-09-2003, 07:14 AM
thank you everyone for your replys, since my computer is occupied at the moment, ill have to try working with all this info tommorrow.
@ rhankins that all sounds interesting, and i would definately be inerested in some more information.
i had thought about using surface flow, but wasnt sure how it would work. never used it before.
guess the first thing to do would be to try to add some more verts in there like zachgrachan said, i know i made the mountain a collision object....
thanks again, and again rhankins, i would be really interested in what you were talking about, maybe even redo what i have
10-09-2003, 05:18 PM
If you add per particle attributes goalUPP, goalVPP and check need parent UV for the particles then you can control where the particles are located on the surface using an expression or ramp. For instance, lets say that the V coord of the nurbs surface you're emitting particles from is going alongside the mountain and the U direction is going down the mountain you could write a creation expression
goalVPP = rand(0,1);
This will randomly distribute particles along the surface. Then you could create a ramp for the goalUPP attribute contolled by the lifespan of the particle. As the particles get older, they slide down the mountain. When a particle dies, it has reached the bottom. You can still add dynamics forces or add more expressions to make the effect more interesting.
10-09-2003, 09:20 PM
thanks rhankins, ill try that as soon as i get back home from my classes this evening, just home on break between classes, and had to do gesture drawings for my next class. thanks again
10-10-2003, 07:21 AM
ok, not wuite sure how to set up the ramp to make the particles slide down the mountain. ive added the expression to goalU(my down the mountain) and when i play the simulation particles do appear randomly between the top and the bottom of the mountain.
now i go to goalV and say create ramp o
and in the options i say lifespan of particles.
now do i have to connect this to anything else, cuz it doesnt seem to do anything as is. but im not sure where to go. also, could i set it up as particles age and connect the particles age to the number of spans i have in the U direction somehow.
thanks again, and sorry bout the hand holding i need
10-10-2003, 04:45 PM
What you want is for the particles to appear uniformly distributed across the surface. So for example if you want the stream to flow down the mountain and U is the direction down the mountain then V would be the direction across the mountain. If V is the direction across the mountain then you want
goalVPP = rand(0,1);
for the creation expression. This will randomly place the particles along the V direction at birth. You then want to have some way to have the particles move down the mountain. So create a ramp on the goalU attribute. This should be a grayscale ramp. Control the particles position in U by their age (this is the default when you create a ramp on a per particle attribute). What this ramp is doing is telling the particles to go from U = 0 to U = 1 as their ageNormalized attribute goes from 0(birth) to 1(death). Now if you playback the scene the particles should move either up or down the mountain depending on which end of the stream nurbs surface has U coord = 0. If they are moving up, then invert the ramp so they move down
10-10-2003, 05:20 PM
ok, i think i understand whats going on here. i think my problem is that im using goalU and goalV under per particle array attributes, not goalUPP and goalVPP. the only problem is that i dont actually see these attributes under per particle array atributes. i see other attributes with a PP at the end, like radiusPP, but not the two mentioned above. am i doing something wrong, or do i have to wire these myself somehow..... :)
thanks for all the help
btw, using Maya 5, in case its pertinant
oh, and another question, does rand(0,1) return a int or a float
10-10-2003, 07:22 PM
I apologize. You need to first select the particles and the surface and then go particle->goal to first set the nurbs surface as a goal for the particles. What I was referring to as goalUPP and goalVPP are actually goalU and goalV in the list of predefined per particle attributes. I stuck the PP at the end to imply that you want to add these attributes per particle instead of per object.
10-10-2003, 08:47 PM
thanks for all your help, one more question. is there a way too keep the particles from the edge of the surface.
i tried using
rand(.25, .75) but it didnt seem to make a difference. guess i could make the plane flat in between the trough i have for my stream. im trying to keep it below ground level
what im trying to do (http://userweb.suscom.net/~eric81/screen3.jpg)
10-11-2003, 03:46 AM
What you're doing should work. In the Goal Weights and Objects tab of the particleShape do you have the goal weight for the surface set to 1? If not, you could have some jiggling and the particles bouncing around as they go down the mountain. Setting goal weight to 1 will force the particles to lie on the surface. If you want to add some randomness to their motion you could add a goalOffset per particle attribute and write an expression on that.
10-11-2003, 07:37 PM
thanks for all yor help
10-14-2003, 03:19 PM
wonderful instructions, rhankins, thank you very much... was faced with a similar problem.
however, i had an additional problem: for some reason, my NURBS surface had messed up UV parameterisation. This caused the particles to appear 2/3 down the surface instead of at the top!
Rebuilding the surface turned out to solve the problem. Probably because it reset the UV range to 0-1 instead 0-7 or something.
can anyone tell me what caused these messy UVs in my NURBS surface? I really suck at NURBS modelling, so...
10-14-2003, 03:52 PM
NURBS have a tendency to be screwed up until rebuilt. Pretty much anything but the perfect situation in creating the surface will cause weird numbers. I think pretty much the only operation that will create proper parameterization is loft(and only when the curves match just right). Rebuilding is probably your best bet.
10-14-2003, 03:55 PM
right. well... I suppose it's good to know, eh :rolleyes:
01-16-2006, 07:00 AM
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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.