Thread: Little help setting up OpenGL

  1. #1
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

    Little help setting up OpenGL

    How do I change the following lines during the initialization, so that
    the origin is at the center and not at the bottom left ?
    Code:
        glMatrixMode ( GL_PROJECTION );
         glLoadIdentity(); 
        gluOrtho2D ( 0.0, (GLdouble)320, 0.0, (GLdouble)240 );

  2. #2
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    For a clipping rectangle with width xSize and height ySize:
    Code:
    gluOrtho2D(-xSize/2.0, xSize/2.0, -ySize/2.0, ySize/2.0);
    Consider this post signed

  3. #3
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Excellent.
    Thank you very much...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-02-2010, 01:26 PM
  2. OpenGL Quesiton: Does Windows XP, Vista still at OpenGL 1.1?
    By indigo0086 in forum Game Programming
    Replies: 8
    Last Post: 05-21-2007, 11:18 AM
  3. Replies: 5
    Last Post: 02-12-2006, 08:42 PM
  4. setting up opengl for windows xp
    By dragonlady in forum C++ Programming
    Replies: 3
    Last Post: 01-03-2006, 02:47 AM
  5. Help setting up OpenGL using Borland command line tools
    By Unregistered in forum Game Programming
    Replies: 2
    Last Post: 07-19-2002, 10:08 AM