SFML community forums
Help => Graphics => Topic started by: Williamson on July 02, 2009, 11:34:03 am
-
Hi
For a game I am making, I need to draw a sphere, representing a planet.
However, I cannot work out how do texture a sphere create dwith this code, by using a sf::Image
gluSphere(params,25,20,20);
Thanks for any help that can be offered :)
Williamson
-
I may have found a solution: does anyone know of an example of the Bind() function of the Image class, used in conjunction with a gluSphere.
Thanks!
Williamson
-
It has nothing to do with SFML and sf::Image, you just have to generate proper texture coordinates for your sphere.
If I remember correctly, you can't do that directly with gluSphere.
-
Take into notice that SFML Clamps the images. You must reset the texture wrapping to GL_REPEAT using glTexParameter after calling sf::Image::Bind()
:)
Goodluck!
-
Take into notice that SFML Clamps the images. You must reset the texture wrapping to GL_REPEAT using glTexParameter after calling sf::Image::Bind()
Which won't work if there's padding in your texture ;)