Problem addressing elements of vector4

   730   1   0
User Avatar
Member
1 posts
Joined: May 2016
Offline
Last night a friend asked me for input on why this little snippet of code won't work.



This turned out to be a real bit of frustration as z.xz and its ilk refused to accept anything, and I do mean anything. This works of course, but I'd really like to know why it refused all those seemingly reasonable alternatives.

float f = min(z.x + z.z, 0.0);
z.x -= f;
z.z -= f;
User Avatar
Member
7803 posts
Joined: Sept. 2011
Offline
AdamNixon
This works of course, but I'd really like to know why it refused all those seemingly reasonable alternatives.

Because they aren't valid. VEX isn't glsl. Double subscript is for matrix row/column access.
  • Quick Links