0 Replies - 3937 Views - Last Post: 24 December 2012 - 03:08 AM Rate Topic: -----

#1 troels_y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-August 09

Flipping x,y axes in OpenGL

Posted 24 December 2012 - 03:08 AM

I want to flip the y axis in OpenGL to look like PyGame, where (0,0) is the top left corner and (0, height) is the lower left corner.
Is this possible?

This is how I initialize graphics:
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluOrtho2D(0, w, 0, h)
glMatrixMode(GL_MODELVIEW)


My definition of Quads:
glBegin(GL_QUADS)
glTexCoord2f(0,0); glVertex2f(0,0)
glTexCoord2f(0,1); glVertex2f(0,height) 
glTexCoord2f(1,1); glVertex2f(width, height)
glTexCoord2f(1,0); glVertex2f(width, 0)
glEnd()


Is This A Good Question/Topic? 0
  • +

Page 1 of 1