PDA

View Full Version : how to use two different bitmap as texture of a sphere ?



fla888
07-24-2014, 10:00 AM
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.

fla888
07-24-2014, 11:38 PM
in another word,is it possible to only add a bitmap texture to half of sphere ?

Carmine
07-25-2014, 10:15 AM
.... 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.

1377

fla888
08-04-2014, 09:57 AM
Carmine,thank you~

Carmine
08-04-2014, 02:48 PM
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.