Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Okay, so in LWJGL, how can I render a 2D object (maybe for like a menu, or meter that shows up on screen during the game), and have control over size and position on screen? So I can tell it what position relative to the screen. It is a 3d game using gluPerspective (as opposed to glOrtho).

share|improve this question
    
use LWJGL forum –  iamcreasy Jul 6 '11 at 10:35

1 Answer 1

up vote 3 down vote accepted

You can render the normal game objects using perspective view, and then when the render func is done with that, switch to orthographic view and render your GUI or whatever it is, this way.

Using glOrtho you can define your screen going exactly from left 0 to right 1 and the same for bottom and up. Since there is no perspective distortion anymore, those coordinates directly map to screen coordinates then.

share|improve this answer
    
Cool, thanks! It works perfectly. –  Brandon oubiub Jul 6 '11 at 19:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.