Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Dynamics & Special Effects (https://simplymaya.com/forum/forumdisplay.php?f=33)
-   -   Position Attribute in Expression Question (from Learning Maya Dynamics 5) (https://simplymaya.com/forum/showthread.php?t=12307)

Gun-Kata 20-06-2004 06:46 AM

Position Attribute in Expression Question (from Learning Maya Dynamics 5)
 
float $nz = 3* noise (nurbsPlane1ParticleShape.position*.1 + time);
nurbsPlane1ParticleShape.position = nurbsPlane1ParticleShape.position0 + <<0,$nz, 0>>;


Hi, that expression is used to control the y value of each particle in a grid of particles that has been parented to a nurbs plane. The result looks kind of like cloth blowing in the wind. What I don't understand is how the part that is in red can possibly be used to assign each particle its own y coordinate. Isn't position a vector attribute? How then can it yield a scalar value for $nz? And furthermore, how is it that it yields a different y value for each particle in the field?

:confused: :confused: :confused: :confused:

kbrown 20-06-2004 01:12 PM

The answer lies in the second line. The scalar value is used in a vector <<0, $nz, 0>>. Why does it yield to a different y value? Well, because the vector is added to the initial position of a given particle.

Gun-Kata 20-06-2004 06:14 PM

Thanks! What I still don't understand though is how an equation that uses a vector quantity with three distinct numerical components (nurbsPlane1ParticleShape.position) can yield a single decimal numerical value (float $nz).

If, for example, nurbsPlane1ParticleShape.position is equal to <<2,3,4>> and that value is then inserted into the equation, then shouldn't the equation also yield a vector quantity?



ps. Nice Quake III model btw.

kbrown 21-06-2004 01:57 AM

Ah... Now I see what you mean. It is because of automatic type conversion. In this case the .position vector is automatically converted to a float by calculating a magnitude (length) of it.

These two will yield to the same result:

float $nz = <<1, 2, 3>>;
float $nz = mag(<<1, 2, 3>>);

Gun-Kata 21-06-2004 02:35 AM

Quote:

Originally posted by kbrown
Ah... Now I see what you mean. It is because of automatic type conversion. In this case the .position vector is automatically converted to a float by calculating a magnitude (length) of it.

These two will yield to the same result:

float $nz = <<1, 2, 3>>;
float $nz = mag(<<1, 2, 3>>);

Now I get it. Thanks!

mind_raper 21-06-2004 07:06 AM

kool explaination
Kbrown...

......


All times are GMT. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018