Apply a texture to a sphere?!?!
Im sure this is a newbie question, but how do you apply a texture to a sphere? My sphere is
...
glutSolidSphere (2,30,30);
...
Any help is much appreciated
Thanks
¤¤¤--When you lose your power to laugh, you lose your power to think--¤¤¤
¤¤¤--When you lose your power to laugh, you lose your power to think--¤¤¤
just enable texture and bind one before you draw it.
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, texID );
//draw sphere
You should never let your fears become the boundaries of your dreams.
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, texID );
//draw sphere
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
April 27, 2002 11:16 AM
glBindTexture(GL_TEXTURE_2D, texID);
GLUquadricObj* q = gluNewQuadric();
gluQuadricDrawStyle(q, GLU_FILL);
gluQuadricNormals (q, GLU_SMOOTH);
gluQuadricTexture (q, GL_TRUE);
gluSphere(q, 0.9, 10,10);
//glutSolidSphere (2,30,30);
gluDeleteQuadric(q);
Hope this helps
GLUquadricObj* q = gluNewQuadric();
gluQuadricDrawStyle(q, GLU_FILL);
gluQuadricNormals (q, GLU_SMOOTH);
gluQuadricTexture (q, GL_TRUE);
gluSphere(q, 0.9, 10,10);
//glutSolidSphere (2,30,30);
gluDeleteQuadric(q);
Hope this helps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement