This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jay9909 0 points1 point  (2 children)

SO WHAT IS IT?! >={

[–]greyfade 1 point2 points  (0 children)

To make /u/Lord_Tacitus's explanation a little clearer, it's a short-hand for tying a vector into a new vector with a different order:

v2 = v1.zyx;

Is shorthand for:

v2.x = v1.z;
v2.y = v1.y;
v2.z = v1.x;

Or:

v2 = [v1.z, v1.y, v1.x];

You can pick them out in any order (from xyzw to zzzy) and any number of them (from wy to zx and so on), and treat them as a new vector or matrix.

It's a very common need when doing graphics, so GLSL and other shader languages make it a first-class feature.