Results 1 to 3 of 3

Thread: Specifying background (image) in a viewport?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Specifying background (image) in a viewport?

    How can I load a .bmp or .jpg image and set it as background for OpenGL viewport?
    Thank you,
    Luke

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: Specifying background (image) in a viewport?

    this you can do the following way:

    - load your background image as a texture

    - before rendering a frame, change to orthographic projection and render a quad that is exactly screen sized at a distance from the viewer that is nearly the far plane of the viewport

    - then, change to normal perspective mode again, and render the scene.

    Jan

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Re: Specifying background (image) in a viewport?

    Sweet, thank you.
    Luke

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2017, 07:07 AM
  2. how to set viewport background color
    By linuxxy in forum OpenGL ES
    Replies: 0
    Last Post: 09-16-2011, 12:11 AM
  3. Viewport/image help needed
    By smokin123 in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 02-09-2011, 08:01 AM
  4. viewport background color
    By dc333 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-23-2009, 09:07 AM
  5. Draw image out of viewport
    By alexei_shk in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-08-2005, 05:46 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