Results 1 to 2 of 2

Thread: Getting axis coordinates

  1. #1
    Junior Member Newbie
    Join Date
    May 2008

    Getting axis coordinates

    In my graphics scene I have a drawn coordinate system (let it be XYZ) that I want to be able to rotate around imaginary axes bounded to camera. XYZ is drawn at the origin and then rotated. So if I specify (1.0, 0.0, 0.0) as vector coordinates to glRotatef call, it will rotate the scene around the current XYZ coordinate. As I understand I have to multiply (1.0, 0.0, 0.0) by inverse projection matrix and then multiply the result by inverse modelview matrix to get coordinates of the axis that coincide with screen X axis. Is that right?

  2. #2
    Junior Member Newbie fldz's Avatar
    Join Date
    Mar 2007

    Re: Getting axis coordinates

    I'm a n00b & not sure I understand the question, but what the hell.

    Something I noticed trying to build a skeleton. No matter how many nested push/pop matrix, you can read the absolute coords of any joint directly from the MODELVIEW_MATRIX.

    glGetFloatv,GL_MODELVIEW_MATRIX,offset matrix1

    offset matrix1 + 12(dwords) will be float X
    offset matrix1 + 13 Y
    offset matrix1 + 14 Z

    Maybe that's relevant.

Similar Threads

  1. Replies: 0
    Last Post: 04-30-2018, 09:49 AM
  2. Texture Coordinates and Depth Buffer to obtain world coordinates
    By snkhan42 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-27-2018, 11:52 AM
  3. How to rotate objects around global axis not local axis
    By silvermeteor in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-04-2017, 11:10 AM
  4. Replies: 4
    Last Post: 06-08-2016, 07:01 PM
  5. Axis and Angle to Axis and prepndicular Vector
    By Maku in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-29-2001, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean