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

Thread: Why OpenGL use in my prog. left coordinate system

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2010
    Posts
    2

    Why OpenGL use in my prog. left coordinate system

    I wrote program which generate this picture
    [img:center]http://w677.wrzuta.pl/sr/f/01jTmePucq7/gl[/img]
    and the code for axial is
    "
    glLineWidth(3.0f);
    glBegin (GL_LINES);
    glColor3f (1.0f, 0.0f, 0.0f); //red green blue
    glVertex3f (0.0f, 0.0f,0.0f);
    glVertex3f (0.0f, 200.0f,0.0f);

    //red line Y axis
    glColor3f (0.0f, 1.0f, 0.0f);
    glVertex3f (0.0f, 0.0f,0.0f);
    glVertex3f (200.0f, 0.0f,0.0f);

    //green line X axis
    glColor3f (1.0f, 1.0f, 1.0f);
    glVertex3f (0.0f, 0.0f,0.0f);
    glVertex3f (0.0f, 0.0f,200.0f);

    //blue line Z axis
    glEnd ();
    "
    why it's looke like left-handle coordinate thus opengl use right coordinate system?

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    491

    Re: Why OpenGL use in my prog. left coordinate system

    hm, perhaps you have multiplied a negative scale onto the matrix stack?

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2010
    Posts
    2

    Re: Why OpenGL use in my prog. left coordinate system

    I don't multiplet by negative , but i thing i find solution, look at this site OpenGL Projection Matrix

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Why OpenGL use in my prog. left coordinate system

    Your picture is ambiguous because it uses no hidden line removal.

    You could be below and to the left of the origin, with the Z axis shooting up over your right shoulder (right-handed axes)...

    Or you could be up and to the right of the origin, with the white line shooting our and away from your left foot (left-handed axes)...

    Unless you have a negation in your lookat transform, I'd suspect the former since OpenGL is right-handed.

    Turn on depth test and render some surfaces to remove the ambiguity.

Posting Permissions

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