PDA

View Full Version : Background Image in perspective mode



PJDIXIT
07-01-2009, 08:30 AM
Hi,

I am rendering a scene with option to use Orthographic projection as well as perspective projection.

I am able to draw full screen background image using orthographic projection, but I don't know how to do it in perspective mode. In perspective mode the background image appears very small as I am rendering on a screen size rectangle with background texture mapped to it, near far clipping plane

Any ideas?

Thanks a lot :)

-Prasad

MaxH
07-01-2009, 02:46 PM
I am rendering a scene with option to use Orthographic projection as well as perspective projection.

I am able to draw full screen background image using orthographic projection, but I don't know how to do it in perspective mode. In perspective mode the background image appears very small as I am rendering on a screen size rectangle with background texture mapped to it, near far clipping plane. Any ideas?
An image can be generated with some elements in ortho mode and other elements in persp mode. I suggest you start in ortho mode (with Z-buffer off), draw the background image, then switch to persp or ortho to draw the rest of the scene.

I do something similar in my texture loading demo, where I draw the OpenGL logo in the upper left hand corner of the screen in ortho mode, then draw an earth and floor in perspective mode. See the routine 'Render_Scene' in the file 'source.cpp' at:

Texture & Image Loading Demo (http://www.mfwweb.com/OpenGL/Loading_Textures/)