• Create Account

### #Actualgarrus

Posted 28 February 2013 - 06:54 AM

Thanks Nercury

^ meant simply the transpose (to get a column vector from [0 0 -1] )

To store each rotation, i'd imagine you mantain 3 angles for the object, which you modify according to user input, and from these you transform the unit vectors of the axes

( [1 0 0] , [0 1 0] , [0 0 1])  to get the transformed orientation.

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

Edit: I guess I should have answered YES. I am actually not sure if maintaining transformation matrix with both rotation and translation for EVERY object has any benefits versus simply calling glTranslate, glRotate.

I meant, keeping such a matrix for every object, and calling glMatrixMult before drawing the object.

If you didn't do this, wouldn't you need to call a glTranslate and 3 glRotates for every object either way?

### #2garrus

Posted 28 February 2013 - 06:54 AM

Thanks Nercury

^ meant simply the transpose (to get a column vector from [0 0 -1] )

To store each rotation, i'd imagine you mantain 3 angles for the object, which you modify according to user input, and from these you transform the unit vectors of the axes

( [1 0 0] , [0 1 0] , [0 0 1])  to get the transformed orientation.

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

Edit: I guess I should have answered YES. I am actually not sure if maintaining transformation matrix with both rotation and translation for EVERY object has any benefits versus simply calling glTranslate, glRotate.

I meant, keeping such a matrix for every object, and calling glMatrixMult before drawing the object.

If you didn't do this, wouldn't you need to call a glTranslate and 2 glRotates for every object either way?

### #1garrus

Posted 28 February 2013 - 05:58 AM

Thanks Nercury

^ meant simply the transpose (to get a column vector from [0 0 -1] )

To store each rotation, i'd imagine you mantain 3 angles for the object, which you modify according to user input, and from these you transform the unit vectors of the axes

( [1 0 0] , [0 1 0] , [0 0 1])  to get the transformed orientation.

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

Edit: I guess I should have answered YES. I am actually not sure if maintaining transformation matrix with both rotation and translation for EVERY object has any benefits versus simply calling glTranslate, glRotate.

I meant, keeping such a matrix for every object, and calling glMatrixMult before drawing the object.

If you didn't do this, wouldn't you need to call a glTranslate and 3  glRotates for every object either way?

PARTNERS