node ninja
node ninja

Reputation: 32986

Vector transformations in OpenGL ES

Why are vector transformations done in reverse order in OpenGL ES? Is it because the vectors are stored in column-matrix form? It seems that they have made things unnecessarily difficult.

Upvotes: 0

Views: 305

Answers (1)

duffymo
duffymo

Reputation: 308753

It probably has to do with the fact that vector transformations aren't commutative. Changing the order can give you a different result.

A simple thought experiment proves the point:

  1. For a unit vector (1, 0, 0), a +90 degree rotation about the z-axis, followed by a +90 degree rotation about the x-axis results in a vector (0, 0, 1).
  2. If you start with the +90 degree rotation about the x-axis, followed by the +90 degree rotation about the z-axis, you'll have a vector (0, 1, 0).

Upvotes: 1

Related Questions