PDA

View Full Version : How to display image far away from the camera view?



Lanfear
03-03-2004, 03:55 AM
Just like to ask if anybody knows how to display an image at a distance away from the camera view. I know image can be displayed via gluOrtho2D but that places the image at z=0. I tried using glOrtho() and glRaster3d(0,height,z) but it doesnt work. Is there any other way to display image?

Thank you.

nexusone
03-03-2004, 04:22 AM
How are you putting the image on the screen?

The best way would be having the image place on a quad as a texture.

In ortho mode, you could scale the image down as you move it away from the camara on the Z axis. To make it look like it is at a distance.

Or just draw it in perspective mode and it will be automatically adjusted as you move it back along the Z axis.



Originally posted by Lanfear:
Just like to ask if anybody knows how to display an image at a distance away from the camera view. I know image can be displayed via gluOrtho2D but that places the image at z=0. I tried using glOrtho() and glRaster3d(0,height,z) but it doesnt work. Is there any other way to display image?

Thank you.

Lanfear
03-03-2004, 04:50 AM
> How are you putting the image on the screen?

I display the image using glDrawPixel, and i want it to be the same size as the window no matter how i change my viewpoint.

>The best way would be having the image place on a quad as a texture.

Therez no way to use glDrawPixel(), glOrtho() and glRaster3i(0,height,z) at the same time?

Thanx for your reply..

nexusone
03-03-2004, 05:59 AM
Well you have the command glPixelZoom, but not sure it is what you want.

What are you trying to do?

If you want a image to be say for a background with objects in front of it, using a texture quad is still the best answer. You can resize the quad to match the window size, after a window reshape.
Also in ortho mode you can move it along the Z axis and it will still fill the screen.

As for your last question, I see no reason that you could not use them at the same time, but I don't think it would give you the effect that you want.



Originally posted by Lanfear:
> How are you putting the image on the screen?

I display the image using glDrawPixel, and i want it to be the same size as the window no matter how i change my viewpoint.

>The best way would be having the image place on a quad as a texture.

Therez no way to use glDrawPixel(), glOrtho() and glRaster3i(0,height,z) at the same time?

Thanx for your reply..

[This message has been edited by nexusone (edited 03-03-2004).]

[This message has been edited by nexusone (edited 03-03-2004).]