LWJGL Forum

Programming => OpenGL => Topic started by: renanse on September 18, 2007, 20:43:08

Title: resetting ortho to a given area
Post by: renanse on September 18, 2007, 20:43:08
I have a rectangle something I am rendering in ortho mode.  It's an arbitrary size and may be arbitrarily placed on the screen (x,y).  I want to now render this rectangle to an FBO without changing the rendering code... easy enough...  but now I want to change the code so that the fbo ends up being exactly filled by the ortho rectangle... and here is where I am stuck.  is this something I can do simply via camera matrix commands?
Title: Re: resetting ortho to a given area
Post by: Fool Running on September 19, 2007, 13:40:04
Try using GL11.glOrtho(left, right, bottom, top, zNear, zFar) to set the view for the rectangle bounds.
Title: Re: resetting ortho to a given area
Post by: renanse on September 19, 2007, 15:09:43
yeah, tried that, thanks.  Seems like I also need some kind of model matrix or something of that ilk...
Title: Re: resetting ortho to a given area
Post by: renanse on September 19, 2007, 16:52:48
I ended up just rendering and using uvs to trim down for now.