+/*
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+ glBegin(GL_POINTS);
+ for (int i=0; i<500; i++) {
+ Vec3 p;
+ p.x = (float)rand() / RAND_MAX * 8 - 4;
+ p.y = (float)rand() / RAND_MAX * 4;
+ p.z = 0;
+
+ Vec3 tmp = inverse(head_xform) * p;
+ if(coll_sphere.contains(tmp)) {
+ glColor3f(1, 0, 0);
+ }
+ else glColor3f(0, 1, 0);
+
+ glVertex3f(p.x, p.y, p.z);
+ }
+ glEnd();
+ glPopAttrib();
+*/
+ float plane[4] = {
+ 0, 0, 0.5 / 350, 0.5
+ };
+
+ glPushMatrix();
+ glRotatef(90, 1, 0, 0);
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_LIGHTING);
+ glEnable(GL_TEXTURE_1D);
+ glBindTexture(GL_TEXTURE_1D, grad_tex);
+ glFrontFace(GL_CW);
+ glEnable(GL_TEXTURE_GEN_S);
+ glTexGenfv(GL_S, GL_OBJECT_PLANE, plane);
+ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+ glColor3f(1, 1, 1);
+
+ glDepthMask(0);
+
+ glutSolidSphere(350, 16, 8);
+ glDisable(GL_TEXTURE_1D);
+
+ glColor3f(0.2, 0.2, 0.2);
+ glutWireSphere(350, 32, 16);
+
+ glDepthMask(1);
+ glFrontFace(GL_CCW);
+ glPopAttrib();
+
+ glPopMatrix();
+