110 assert(w_color == 3);
166 for(
size_t i = 0; i < 3 * o.
m_numFaces; ++i )
178 float ambient_color[] = {r, g, b};
179 float diffuse_color[] = {0.45f * r, 0.5f * g, 0.55f * b};
181 float specular_color[] = {0.1f, 0.15f, 0.1f};
182 float shine[] = {0.1f};
184 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient_color);
185 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse_color);
186 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular_color);
187 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, shine);
212 glDisable(GL_LIGHTING);
213 glDisable(GL_TEXTURE_2D);
214 glColor3f(0.0, 0.0, 0.0);
218 size_t index = 3 * i;
220 int b = 3 *
m_faces[index + 1];
221 int c = 3 *
m_faces[index + 2];
222 glBegin(GL_TRIANGLES);
229 glEnable(GL_LIGHTING);
230 glEnable(GL_TEXTURE_2D);
244 glEnableClientState(GL_VERTEX_ARRAY);
245 glEnableClientState(GL_NORMAL_ARRAY);
246 glEnableClientState(GL_COLOR_ARRAY);
251 glEnable(GL_LIGHTING);
252 glEnable(GL_COLOR_MATERIAL);
257 glVertexPointer( 3, GL_FLOAT, 0,
m_vertices.get() );
259 glColorPointer( 3, GL_UNSIGNED_BYTE, 0,
m_colors.get() );
262 glDrawElements(GL_TRIANGLES, (GLsizei)3 *
m_numFaces, GL_UNSIGNED_INT,
m_faces.get());
291 glDisable(GL_LIGHTING);
292 glColor3f(1.0, 1.0, 0.0);
293 glRasterPos3f(v.
x, v.
y, v.
z);
294 for(
int i = 0; i <
Name().size(); i++)
298 glEnable(GL_LIGHTING);
316 size_t a, b, c, buffer_pos;
331 b =
m_faces[buffer_pos + 1] * 3;
332 c =
m_faces[buffer_pos + 2] * 3;