Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Picture in background

  1. #1
    Intern Contributor
    Join Date
    Feb 2001
    Location
    Hungary
    Posts
    60

    Picture in background

    I want to display a moving, rotating world in front of a non-moving bitmap background.
    I tried glDrawPixels(), but it is extremely slow. It has made of a 20 fps scene a 0.5-1 fps one. I can't use glBitmap() because I use a 24 bit .bmp file for the background. As far as I know, glBitmap() is only for b/w bitmaps.
    I can't use a textured 'QUADS' as a background, because gluLookat() always changes.
    If You don't understand this question, just think of ResidentEvil like games...

    Does anyone know a fast way to display a non-moving background?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Picture in background

    I can't use a textured 'QUADS' as a background, because gluLookat() always changes.
    True, but what stops you from drawing the quad before you use gluLookAt?

    Actually, a textured quad is THE way to do it. At the point where you need to draw the background, preferably instead of glClear, do something like this.
    Code :
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
     
    glBindTexture(...);
    glBegin(GL_QUADS);
        glTexCoord2f(0, 0); glVertex3f(-1, -1, 1);
        glTexCoord2f(0, 1); glVertex3f(-1,  1, 1);
        glTexCoord2f(1, 1); glVertex3f( 1,  1, 1);
        glTexCoord2f(1, 0); glVertex3f( 1, -1, 1);
    glEnd();
     
    glPopMatrix();
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2005
    Posts
    1

    Re: Picture in background

    I have a similar question about background images.

    I want to draw a background that will rotate freely around the Z-axis. I assume this would be best done with a textured quad as well, but how do I know what size to make it, and how far back do I translate the quad?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •