PDA

View Full Version : Centering an image in the window



Oihane
06-07-2002, 03:53 AM
I'm trying to center an image in my window, but I'm not able to do that.

I have the xmin, xmax, y min, y max, zmin, zmax of the image, and I've got window's vertex, using rect->bottom, etc.

Then, I've tried to use glOrtho, but not in the correct way, I'm afraid.

Any sugestion?

Thank you,

Oihane

mikael_aronsson
06-07-2002, 05:09 AM
Hi !

If you look in the FAQ on this website you will find information about how to setup glOrtho views. when that is done all you need is the width and height of the viewport and the width and height of the image.

Mikael

Tazar
06-07-2002, 08:08 PM
Well,
http://www.gametutorials.com

has a tutorial on masking & ortho mode if you want to check it out. They also center something somewhere, have no idea in what tut http://www.opengl.org/discussion_boards/ubb/frown.gif.