Activity › Forums › Adobe After Effects Expressions › WHY?????
-
WHY?????
Posted by Jesper Hellvik andersen on January 29, 2008 at 10:00 amI’m afraid of expressions…afraid of losing my mind. WHy on earth can’t I get that #%/&(%(” to work.
It’s soooo simple what I need to do:
wiggle the x position, while holding the y and z position!!!
This is what I tried:
x = wiggle(1,100);
y = 0;
z = 0;
[x,y,z]Help me understand
Jesper Hellvik
Darby Edelen replied 18 years, 3 months ago 3 Members · 3 Replies -
3 Replies
-
Dan Ebberts
January 29, 2008 at 12:55 pmYou need to isolate the x component of the wiggle,
like this:x = wiggle(1,100)[0];
y = 0;
z = 0;
[x,y,z]Dan
-
Jesper Hellvik andersen
January 30, 2008 at 8:18 amThanks Dan
You wrote:
“You need to isolate the x component of the wiggle,
like this:x = wiggle(1,100)[0];
y = 0;
z = 0;
[x,y,z]Dan”
But how come I only have to do that with the x position and not the y and z? I know coding is supposed to be logical, but this seems to me to be some kind “well that’s just how it is” kinda thing.
Cheers
Jesper -
Darby Edelen
January 30, 2008 at 4:50 pm[Jesper Hellvik Andersen] “But how come I only have to do that with the x position and not the y and z? I know coding is supposed to be logical, but this seems to me to be some kind “well that’s just how it is” kinda thing.”
The
wiggle()function returns a vector of the same dimensions as the one it was given.Now you may be thinking “I didn’t give it a vector!” but
wiggle()uses the property it is applied to as its source, in your case:wiggle(1,100);is the same thing as
position.wiggle(1,100);Since a 3D position is a 3 dimensional vector (x, y and z), the
wiggle()function will return a 3 dimensional vector. In your original code you were assigning a 3 dimensional vector to the first element of a 3 dimensional vector and two scalar values to the 2nd and 3rd elements:[[x,y,z],y,z]What Dan did is simply take the x value of the wiggled 3 dimensional vector instead of all 3 of the values:
wiggle(1,100)[0] //returns the first value of the wiggled vector instead of all 3 valuesIt is perfectly logical… at least if you’ve been talking to computers long enough =)
Darby Edelen
Designer
Left Coast Digital
Santa Cruz, CA
Reply to this Discussion! Login or Sign Up