Results 1 to 3 of 3

Thread: glloadidentity

  1. #1
    Guest

    glloadidentity

    where exactly does glLoadIdentity take you? I thought it took you to the center of the window you've drawn but when I use it it actually shows up not at the center but a couple units to the right and couple units up from the exact center of the screen. And when I draw triangles or polygons the units are from the bottom left corner from the screen. does anyone know why that is?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: glloadidentity

    No offense, but you seem to be a bit lost.

    I would suggest that you read chapter 3 of the red book to start with. Here is a link. http://fly.cc.fer.hr/~unreal/theredbook/

    When you've read it, have a glance in appendix G. After this, I think you can answer your own question If not, come back.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: glloadidentity

    The center in openGL is 0,0,0 and loadidenity resets the matrix() to that.

    Now what is happing is that you are thinking in terms of your screen center and not the openGL world center.


    Ortho, perspective modes, these only set the view area.
    glOrtho(0.0f, width, hight, 0.0f,-10.0f,10.0f), set's width = 640, hight = 480. of the viewing area.

    So what is happing is correct in that your object is being drawn at a corner which is where the openGL center is located.

    You translate your object to the position wanted on the screen. which in the case of my example is 320, 240.


    Originally posted by opengl newbie:
    where exactly does glLoadIdentity take you? I thought it took you to the center of the window you've drawn but when I use it it actually shows up not at the center but a couple units to the right and couple units up from the exact center of the screen. And when I draw triangles or polygons the units are from the bottom left corner from the screen. does anyone know why that is?

Similar Threads

  1. glLoadIdentity(), glTranslatef()?
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-01-2004, 07:04 AM
  2. Display lists and glLoadIdentity();
    By sw@T in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-11-2002, 08:30 PM
  3. glLoadIdentity
    By Suf in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-21-2002, 05:29 PM
  4. Replies: 5
    Last Post: 12-06-2001, 10:08 PM
  5. glLoadIdentity
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-17-2001, 04:33 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