OpenGL - screen dimensions

This is a discussion on OpenGL - screen dimensions within the C Programming forums, part of the General Programming Boards category; Hello, I am new to using OpenGL and I have many questions, but the one that has been bothering most ...

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    104

    OpenGL - screen dimensions

    Hello,

    I am new to using OpenGL and I have many questions, but the one that has been bothering most is this one:

    Why is it that if I draw a glVertix2d, for example, and the parameters i called it with are '0.1, 0.1' it appears in the center of the window, which coords are 250, 250. Should it not appear in the top left of the window, since 0.0 is the top left of the Frame?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    In OpenGL by default (0,0) is in the center of the window.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    104
    Quote Originally Posted by tabstop View Post
    In OpenGL by default (0,0) is in the center of the window.
    is there someway i can change that so it is aligned to windows' pixels?

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    I suppose glTranslate would do what you want. You might need to scale, too, depending on how you set up gluPerspective.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    104
    Quote Originally Posted by tabstop View Post
    I suppose glTranslate would do what you want. You might need to scale, too, depending on how you set up gluPerspective.
    good idea! thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  4. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  5. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 03:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21