Advertisement

Apply a texture to a sphere?!?!

Started by April 27, 2002 01:29 AM
1 comment, last by GLwarrior85 22 years, 10 months ago
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.
You should never let your fears become the boundaries of your dreams.
Advertisement
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

This topic is closed to new replies.

Advertisement