0

I implemented my quaternion class like this. I can convert the quaternion to 3x3 rotation matrix, but then how should i apply that to my modelview matrix?

1 Answer 1

1

glMultMatrixf(GLfloat*) and glMultMatrixd(GLdouble*) do exactly what you need. The only thing is to convert 3x3 matrix (O) to 4x4 matrix (O') by adding some 0 and 1:

     |       0|
O' = |   O   0|
     |       0|
     | 0 0 0 1|

Note that openGL stores matrices in column-major order (like in Fortran).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.