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 3 of 3

Thread: OpenGL rotations

  1. #1
    Guest

    OpenGL rotations

    I have a polygon with distinct coordinates that I am rotating an arbitrary amount about an arbitrary axis (both depend on the mouse coordinates). After displaying the polygon, I can clearly see that it has been rotated, but how can I retrieve the new coordinates of the polygon AFTER it's been channeled through the rotation matrix?

    Thanks!
    Dan

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    562

    Re: OpenGL rotations

    Try glFeedbackBuffer with type GL_3D. Be warned, though, that it won't be very efficient. OpenGL is primarily a one-way drawing API and isn't intended to be a general-purpose geometry calculator. If you're going to be doing lots of this in a serious app, either write your own 3D math library or use one of the many freely available ones. (The latter is obviously quicker, but the former is far more instructive.)

    HTH,
    Mike

  3. #3
    Intern Contributor
    Join Date
    Aug 2003
    Location
    Urbana, IL
    Posts
    57

    Re: OpenGL rotations

    Alternatively, you can pull the modelview matrix out with a glGetFloatv(GL_MODELVIEW_MATRIX, matrixPointer) where matrixPointer is a pointer to 16 floats then multiply the coordinates out yourself.
    Geoffrey DeWan

Posting Permissions

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