Results 1 to 3 of 3

Thread: Sumilating A Background Image

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2005
    Location
    Neuss
    Posts
    2

    Sumilating A Background Image

    Hi,

    i am totally new in programing OpenGL-Stuff.

    I try to program a cool featured tool for windows-desktop. Hope that i may introduce it here when its finished...

    But first i have some questions Of course i have...

    I need to simulate an background image behind my "normal" drawn 3d-world. Hope it's clear what i want to do... I want to draw an image first on the screen and then draw 3d-world above it... I tried so hard to figure out how it should work. But it doesn't.

    I tried to draw the picture in glOrtho()-Mode, switched to 3d-perspective, draw my 3d-scene. but nothing happened. The picture was in Front of my scene...

    Then i tried to draw the picture some in the depth of the z-buffer, like anormal 3d-projection. But the problem was that i didn't know how huge i had to make the textured Quad that there were no empty space between the picture and the window-frame...

    I hope i told you clearly about my problem an hope further on that somebody can help me...

    By the way, how can i increase or decrease the quality of textures ?

    Thanks a lot
    Midhas

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: Sumilating A Background Image

    You were on the right track using glOrtho.

    switch to glOrtho and draw your background and be sure to disable z-buffer writes (glDepthMask(GL_FALSE)). This ensures that you won't write any values to the z-buffer so that when you go to draw the rest of your scene it won't take the background into consideration when performing depth testing.

    Now, switch to perspective and enable depth writes (glDepthMask(GL_TRUE)).
    You'll also want to use depth testing most likely (glEnable(GL_DEPTH_TEST)).

    try that out.

    Edit: The quality of a texture is governed by its resolution. There are filtering methods and mipmapping available to you in OpenGL, but a texture will never have a higher quality than the resolution it was created at.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2005
    Location
    Neuss
    Posts
    2

    Re: Sumilating A Background Image

    Hey that works fine... Thanks dude.

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2017, 07:07 AM
  2. Image Background
    By Leandros in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-20-2010, 01:03 AM
  3. Background image
    By aga2678 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-19-2005, 09:09 AM
  4. cut off background of image
    By dan-leech in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-07-2001, 01:29 AM
  5. How can I put a BMP image in background???
    By Le Bayonnais in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-25-2000, 03:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean