Results 1 to 3 of 3

Thread: Picture in background

  1. #1
    Member 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
    2,978

    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
    3

    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?

Similar Threads

  1. Replies: 3
    Last Post: 04-24-2014, 12:36 PM
  2. picture in picture
    By zukko in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-31-2004, 08:41 PM
  3. How to make an object move without moving the background picture
    By Wayne Linker in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-12-2002, 05:27 AM
  4. picture
    By sgiuser in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-21-2001, 03:24 PM
  5. Background picture...
    By nix in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-26-2001, 06:15 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