I know this is more like an openGL problem, but maybe someone here can help me.
I am trying to apply a texture (of the world map) in a sphere.
Here is the code:
glPushMatrix(); glTranslatef(centerX, centerY, centerZ); // enable texturing glEnable(GL_TEXTURE_RECTANGLE_ARB); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, (GLuint)worldTexture.tex.textureName); //glutWireSphere(200, 30, 30); gluSphere(sphere, 200, 30, 30); glDisable(GL_TEXTURE_RECTANGLE_ARB); glPopMatrix();
(I had to turn ofImage.tex and .textureName public)
To load the texture i put the following code on Setup():
.h: ofImage worldTexture; .cpp: worldTexture.loadImage("world-map.jpg");
I tried applying the texture to a gluSphere and a glutSolidSphere but without any luck.
Does anyone has any experience in applying texture to 3D objects?