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 5 of 5

Thread: how to use two different bitmap as texture of a sphere ?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2014
    Posts
    5

    how to use two different bitmap as texture of a sphere ?

    I want to use two bitmap as texture of sphere ,each bitmap will be used as texture of half sphere . could somebody give some suggestions on how to implement this effect ?
    is there some demo can be reference to ? thanks very much.

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2014
    Posts
    5
    in another word,is it possible to only add a bitmap texture to half of sphere ?

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    189
    .... is it possible to only add a bitmap texture to half of sphere ?
    Yes. It's possible and fairly straight forward using glClipPlane. Put your textures on two separate spheres (same size, same origin). Then cut away a half of one sphere and the opposite half of the second sphere. This is done on the earth image on the left. Use glClipPlane to do the 'cutting'.

    In this case I found that the transition between the textures was too harsh, so I came up with a way to blend the two textures into one, allowing a gradual transition across the terminator. glClipPlane is not used in the picture on the right. There is one sphere with a pre-processed texture mapped onto it.

    Click image for larger version. 

Name:	Globes.jpg 
Views:	28 
Size:	52.0 KB 
ID:	1377

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2014
    Posts
    5
    Carmine,thank you~

  5. #5
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    189
    I used the techniques above because my texture changes with time, i.e. when the simulation runs, the line between day and night moves across the continents. If the two images you are working with don't change with time, you could simply use an image editor, such as Photoshop, to combine them into one, and map that onto a sphere.
    Last edited by Carmine; 08-04-2014 at 02:56 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
  •