Results 1 to 2 of 2

Thread: Displaying large photos using OpenGL

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    1

    Displaying large photos using OpenGL

    Hi all,

    I've been learning about OpenGL recently. I am using an old implementation of 1.2 as I only have VB6 available to me to develop in. I know this isn't the best solution but it's all I have at the moment.

    I have been following the NeHe tutorials and have gained a good grasp on the basics.

    My application gives the user the ability to draw polygons by clicking on my canvas and to give these polygons a 'height' so they display as 3d objects. The user can navigate their 3d scene in a manner similar to google earth ie the camera can be tilted and rotated and zoomed in and out.

    My problem is this. I am trying to give my app the ability to display a large photo, say up to 3000x3000 pixels as a 'floor' to the scene. This floor can be completely flat. It does need to be one large photo/bitmap, rather than a smaller grass texture/water texture etc. I can't see any way of simply reading in the bitmap and and displaying it as a 3d surface. I came to the conclusion that the way to do this is to create multiple tile objects and to texture these tiles with textures created from tiles of the original photo.

    I kind of have this working but the frame rate just drops through the floor, and I also can't seem to get rid of a red cast which is over the whole photo.

    Am I taking the correct approach here or is there a better way?

    Thanks in advance

    Mike

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,103
    Quote Originally Posted by MikeArmstrong View Post
    I came to the conclusion that the way to do this is to create multiple tile objects and to texture these tiles with textures created from tiles of the original photo.
    Sounds about right.

    Quote Originally Posted by MikeArmstrong View Post
    I kind of have this working but the frame rate just drops through the floor,
    Are you re-uploading the texture data every frame?

    Do you have enough video memory to hold all of the textures? If the implementation has to swap data between system memory and video memory, frame rate will suffer.

    Quote Originally Posted by MikeArmstrong View Post
    and I also can't seem to get rid of a red cast which is over the whole photo.
    By default, texture colours are multiplied with the current colour (determined by glColor() and/or lighting). If you want texture colours to be reproduced exactly, you need to disable lighting and set the current colour to white (or use glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_REPLACE) to force the current colour to be ignored when texturing is enabled).

Similar Threads

  1. Making an opengl object from photos (mobile devices)
    By Raffaele Chiocca in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-28-2012, 09:57 AM
  2. model from photos
    By forever23 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-29-2009, 01:48 PM
  3. Displaying large textures
    By Ian2004 in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-28-2004, 03:08 AM
  4. Displaying large textures
    By apanos in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-10-2002, 08:31 PM

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