+
+static void draw_text(const char *text, int x, int y, float sz, const Vec3 &color)
+{
+ glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POINT_BIT);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+ glLineWidth(3);
+ glPointSize(3);
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho(0, win_width, 0, win_height, -1, 1);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ glTranslatef(x, y, 0);
+ glScalef(0.1 * sz, 0.1 * sz, 1);
+
+ glColor3f(color.x, color.y, color.z);
+ while(*text != '\0') {
+ glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, *text);
+ text++;
+ }
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+
+ glPopAttrib();
+}
+
+static void update_sball_matrix()
+{
+ Mat4 rot = sball_rot.calc_matrix();
+ //rot.transpose();
+
+ Mat4 trans;
+ trans.translation(sball_pos);
+
+ sball_xform = rot * trans;
+}