Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kitschpatrol/803443 to your computer and use it in GitHub Desktop.
Save kitschpatrol/803443 to your computer and use it in GitHub Desktop.
this goes in draw,
glPushMatrix();
glTranslatef(panX, panY, panZ);
glRotatef(rvX, 0, 1, 0); // rotate around y
glRotatef(rvY, 1, 0, 0); // rotate around x
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, (GLuint)mapBalls[i].mapTexture.textureName[0]);
gluSphere(sphere, 200, 30, 30);
glDisable(GL_TEXTURE_2D);
glPopMatrix();
@kitschpatrol
Copy link
Author

Throw this in your setup to get the context together:

sphere = gluNewQuadric(); // Create new quadric
gluQuadricNormals(sphere, GLU_SMOOTH);       //Default: GLU_SMOOTH
gluQuadricOrientation(sphere, GLU_INSIDE);   //Default: GLU_OUTSIDE  

gluQuadricTexture(sphere, GL_TRUE); // Enable texturemapping
gluQuadricOrientation(sphere, GLU_OUTSIDE);
gluQuadricTexture(sphere, GL_TRUE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment