summaryrefslogtreecommitdiff
path: root/src/Robot.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Robot.java')
-rw-r--r--src/Robot.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Robot.java b/src/Robot.java
index 51fad15..de7943f 100644
--- a/src/Robot.java
+++ b/src/Robot.java
@@ -3,6 +3,7 @@ import java.awt.Color;
import javax.media.opengl.GL;
import static javax.media.opengl.GL2.*;
import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.glu.GLUquadric;
import robotrace.Vector;
/**
@@ -105,8 +106,13 @@ class Robot extends BetterBase {
race.getTorsoTexture().bind(gl);
drawTorso();
- //race.getHeadTexture().bind(gl);
+ // Rotate the head so it looks forward (for texturing)
+ gl.glRotatef(180, 0, 0, 1);
+ race.getHeadTexture().bind(gl);
drawHead();
+
+ // Rotate back so the other robot parts are facing the right direction
+ gl.glRotatef(180, 0, 0, 1);
unbindTextures();
@@ -442,7 +448,16 @@ class Robot extends BetterBase {
// Set color and draw head
setColor(asStickFigure ? boneColor : Colors.PALE_TURQOISE);
- glut.glutSolidSphere(headRadius, 32, 32);
+
+ GLUquadric sphere = glu.gluNewQuadric();
+
+ glu.gluQuadricDrawStyle(sphere, glu.GLU_FILL);
+ glu.gluQuadricTexture(sphere, true);
+ glu.gluQuadricNormals(sphere, glu.GLU_SMOOTH);
+
+ glu.gluSphere(sphere, headRadius, 32, 32);
+
+ // glut.glutSolidSphere(headRadius, 32, 32);
// Pop so we are at the origin again
gl.glPopMatrix();