View Full Version : Funky Particles Problem!
zerodefect0 09-02-2002, 12:04 AM Hi people, i have a big problem with some particles and i am hoping some maya wiz can help me!
I have a particle screen which is motionless but some areas of it are affected by fields so some of the particles start moving. Now, the particles have a shader, with a fractal as a color and one of the colors has a ramp attached to it. BASICALLY, i want the color to move up the ramp according to the velocity or acceleration of the particles. See :)
Well basically i need to connect the magnitude of the velocity to the V coordinate of the ramp BUUUT, i have made an expression to add an attribute to the particle shape which calculates the magnitude of the velocity but THEN i have to normalise that because the value needs to be between 0 and 1 (for the ramp) AND THEN THEN THEN, i need to connect that attribute to the ramp and maya just wont let me do that, in the connection editor it wont let me select the attribute i made and connect it to the V coordinate of the ramp. POSSIBELY it is because i did not normalize the velocity magnitude but i dont think so, i am stuck :annoyed:
I would really appriciate any help !!
Thanks alot, take care people :buttrock:
|
|
Jozvex
09-02-2002, 08:44 AM
Well, it sounds complicated!
but for normalizing the velocity, could you convert it to a percentage (say make a velocity of 100 be 100%), then just add a decimal point to the front to make it out of 1.
eg the velocity is 45.655, then convert it to 45% then 0.45?
alexx
09-02-2002, 10:02 AM
bahh.. replied very very long on that one.. but lost..
maybe find the time to reply again this evening.
zerodefect0
09-02-2002, 12:12 PM
yes you did reply alexx! it was avery useful but I just didnt understand how to normalize the velocity and to connect it to the ramp.
Hope you can reply again soon!
Thanks alot :applause:
alexx
09-02-2002, 02:24 PM
if just THAT is the problem :)
to normalize the speed values see the following example:
you have 3 particles and 3 speeds:
p1: v=1
p2: v=5
p3: v=10
to normalize that you have to find the fastest particle (roughly) which is p3.
now you take that speed value and you use it as a divider; so you divide all your particles speeds by the fastest speed. like this all your speed values will be between 0 and 1:
p1: v=1/10 = 0.1
p2: v=5/10 = 0.5
p3: v=10/10 = 1.0
now you can put that normalized output to a ramps U-coordinate.
(particle.normalizedSpeed -> ramp.uCoord).
the output from the ramp is now a per particle color that changes with the speed of your particle.
cheers
alexx
alexx
09-02-2002, 02:36 PM
anyway.. i made you a file..
check especially all the connections.
additionally i made a extra attriburte for particle1 where you can enter the divisor for the normalization..
also: i cut the looping of the ramp.. so yellow is all that has the speed faster than the divisor is..
have fun
alexx
alexx
09-02-2002, 02:46 PM
see the avi:
watch the result movie (3 megs) (http://home.arcor.de/alexander.bigott/speedParticles.avi)
zerodefect0
09-02-2002, 07:11 PM
Cool :)
Movie is cool :)
Thanks for making a file for me but I cant open it I am afraid, I am using maya 3.5 on mac os x. I get a script error when trying to open it :eek:
But other than that its cool although I still dont see how to actually get the values as a script and so that they can be connected to the ramp :(
Thanks alot for the help though !!!!
alexx
09-02-2002, 07:17 PM
argghh..
get a computer man :)
that is 4.01 file..
getting the values to a ramp is fairly easy:
ok.. starting point is you have your normalized speed values in a per particle attribute.
now go to the rgbPP value (that you created) and create a new ramp with the option box for it.
but now you dont connect the particle age, but the speedPP value to its input.. and voila.
if you like you can now edit the connection of the ramp in hypershade to your ramp..
if you want to get these values to your software shader you need to use the particleSampler node in hypershade.
only with that one used you can assign your per particle color to one color of the fractal..
sorry.. but i have no way to create maya files with versions smaller than 4.0
cheers
alexx
zerodefect0
09-02-2002, 11:21 PM
hey, GREAT STUFF
I am ALMOST there, i got it to work pretty much, only a couple of problems.
My first small problem is in getting the max velocity, I made an estimate by working it out using basic physics (its my degree :)) but maybe there is a more sophisticated expression i could use.
My bigger problem is connecting the rgbPP to the Shader. I tried connecting the particle sampler info (triple -> rgbPP) to the color of the particle cloud but when i do the cloud just goes black and if i render it just displays the default bleu.
Not sure what wrong there as it would work in hardware mode but not software.
Thanks alot for the help, i am almost there! i am a beginner so some of ur directions were hard to follow but its a GREAT way to learn !!!
thank again
alexx
09-03-2002, 08:00 AM
to determine the fastest particle you can either eyeball it or be precise.
eyeball:
let your particles run. select a single particle that you think is one of the fastest (in component mode).
go to the component editor and there the particles tab.
now you can see the particles velocity of that particle and you can calculate its magnitude.. voila.
precise:
write a runtime expression that evaluates the velocity for all the particles in all frames and store the fastest velocity in a global variable that you read out after the simulation.
but honestly: eyeballing does the job quite well..
for the other problem i will do some screenshots.. wait.
alexx
09-03-2002, 08:08 AM
like this:
zerodefect0
09-03-2002, 10:42 AM
IT WORKS !!
Great, works fine, perfect.
Thanks alot for the help !!
Take Care !
Maybe I will post some cool renders sometime :thumbsup:
alexx
09-03-2002, 07:23 PM
Originally posted by zerodefect0
Thanks alot for the help, i am almost there! i am a beginner so some of ur directions were hard to follow but its a GREAT way to learn !!!
for a beginner you are quite good to be honest.
after my first post i expected way other questions :)
glad i cuold help.
you are welcome
alexx
CGTalk Moderation
01-13-2006, 03: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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.