简体   繁体   中英

LWJGL glOrtho and drawing axies

This is on a 2d canvas. Ok i want to make glOrtho add to x when going right and minus when going left and i want to add when going up and minus when going down. But when i draw it draws the objects not from bottom left (which is 0,0) it draws from top right (1, 1). I was wandering is there a solution to this? Here is a diagram:

http://i.stack.imgur.com/Srqo9.png

Is there anyway i can change the drawing coords to run in the same directions and axies as the camera ]

glOrtho(853, 0, 480, 0, -1, 1);

glOrtho is set like this:

glOrtho(X start, X length, Y start, Y length, z, z);

if you want to draw from the bottom left and up set it to:

glOrtho(0, 853, 0, 480, -1, 1);

Also if you want to go back to drawing from the top left just swap the Y's around.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM