Like Tree1Likes
  • 1 Post By bernt

Little help setting up OpenGL

This is a discussion on Little help setting up OpenGL within the Tech Board forums, part of the Community Boards category; How do I change the following lines during the initialization, so that the origin is at the center and not ...

  1. #1
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490

    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 );
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  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);
    manasij7479 likes this.
    Consider this post signed

  3. #3
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    Excellent.
    Thank you very much...
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



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, 07:42 PM
  4. setting up opengl for windows xp
    By dragonlady in forum C++ Programming
    Replies: 3
    Last Post: 01-03-2006, 01: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

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