55 glPushAttrib ( GL_ALL_ATTRIB_BITS );
56 const float charWidth = length / 40.0f;
57 const float charHeight = length / 30.0f;
58 const float charShift = 1.04f * length;
60 glDisable ( GL_LIGHTING );
65 glVertex3f ( charShift, charWidth, -charHeight );
66 glVertex3f ( charShift, -charWidth, charHeight );
67 glVertex3f ( charShift, -charWidth, -charHeight );
68 glVertex3f ( charShift, charWidth, charHeight );
70 glVertex3f ( charWidth, charShift, charHeight );
71 glVertex3f ( 0.0, charShift, 0.0 );
72 glVertex3f ( -charWidth, charShift, charHeight );
73 glVertex3f ( 0.0, charShift, 0.0 );
74 glVertex3f ( 0.0, charShift, 0.0 );
75 glVertex3f ( 0.0, charShift, -charHeight );
77 glVertex3f ( -charWidth, charHeight, charShift );
78 glVertex3f ( charWidth, charHeight, charShift );
79 glVertex3f ( charWidth, charHeight, charShift );
80 glVertex3f ( -charWidth, -charHeight, charShift );
81 glVertex3f ( -charWidth, -charHeight, charShift );
82 glVertex3f ( charWidth, -charHeight, charShift );
85 glEnable ( GL_LIGHTING );
86 glDisable ( GL_COLOR_MATERIAL );
93 glMaterialfv ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
color );
100 glMaterialfv ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
color );
102 glRotatef ( 90.0f, 0.0f, 1.0f, 0.0f );
110 glMaterialfv ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE,
color );
112 glRotatef ( -90.0f, 1.0f, 0.0f, 0.0f );
122 GLUquadric* quadric = gluNewQuadric();
125 radius = 0.05f * length;
127 const float head = 2.5f * ( radius / length ) + 0.1f;
128 const float coneRadiusCoef = 4.0f - 5.0f * head;
130 gluCylinder ( quadric, radius, radius, length * ( 1.0f - head/coneRadiusCoef ), nbSubdivisions, 1 );
131 glTranslatef ( 0.0f , 0.0f, length * ( 1.0f - head ) );
132 gluCylinder ( quadric, coneRadiusCoef * radius, 0.0, head * length, nbSubdivisions, 1 );
133 glTranslatef ( 0.0f, 0.0f, -length * ( 1.0f - head ) );
134 gluDeleteQuadric ( quadric );
140 glScalef(10.0, 10.0, 10.0);