Can anyone help me with a programming problem or point me at a suitable tutorial?
I want to use a pixelmap (Windows bitmap) as a background for a 3D rendering.
I can render the 3D models without the background, and I can draw the image (using glDrawPixel), but when I try and combine the two I don't get the objects in front of the image.
What I've done is write an image that occupies half the window (using glDrawPixel), then render the 3D objects.
What I'd hoped for was the image 'behind' the 3D objects.
What I get is the image (with no 3D objects visible)in its half of the window, with the 3D objects visible in the half of the window not covered by the image.
My guess is that when I do the DrawPixel, the image is transfered to the frame buffer with the depth buffer marked as though it was an object at the front of the display space, so the 3D objects are always behind it (I've tried GL_DEPTH_BIAS to 'move the image back' without effect).
Either that or the pipeline is reordering events so the 3D objects are rendered, then the image overwrites them.
Either way it doesn't do what I expect.
Thanks for any help anyone can provide.
Clive Pygott
|
|
0
|
|
|
|
Reply
|
Clive
|
11/25/2003 5:11:04 AM |
|
Clive Pygott wrote:
>
> What I'd hoped for was the image 'behind' the 3D objects.
>
glDrawPixels does depth testing and will write values
to the depth buffer. You need to disable the depth test
when you draw the image.
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
|
|
0
|
|
|
|
Reply
|
fungus
|
11/25/2003 12:08:49 PM
|
|