Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glRotatef and Matrix

  1. #1
    Junior Member Newbie stefkos's Avatar
    Join Date
    May 2012
    Location
    Warsaw
    Posts
    7

    glRotatef and Matrix

    Hey

    I'm writing collada object loader but now I meet small problem. My object is a couple of nodes with position, rotation and scale described in matrix.

    fe:
    <matrix>1 0 0 123.6633836685638 0 1 0 -321.0477037719265 0 0 1 4.969635813978357e-014 0 0 0 1</matrix>

    I've read this matrix and tryed to use it by multiply current matrix glMulMatrixf( mymatrix ); but my parts were not in correct places.
    Then I used glTranslatef() and values from matrix m[ 3 ] as x, m[ 7 ] as y and m[ 11 ] as z and translation works ok. But now i have problems with rotation. I readed a lot of pages (about euler angles, quaterions, opengl, etc) and this forum to find solution but no success.
    Can someone write some lines how to translate this matrix to rotation x,y,z (angle values for glRotatef() ).

    Thx

  2. #2
    Junior Member Newbie stefkos's Avatar
    Join Date
    May 2012
    Location
    Warsaw
    Posts
    7
    Well, there is just need to load this matrix into float table, then transpose it and use glMultMatrixf().
    Voaula! Solution

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •