static void cubes(int mx, int my, int mode) { int x, y, z, i; /* track the mouse */ glRotatef(mx / 2.0, 0, 1, 0); glRotatef(my / 2.0, 1, 0, 0); /* draw the lines as hidden polygons */ glTranslatef(-0.5, -0.5, -0.5); glScalef(1.0 / dimension, 1.0 / dimension, 1.0 / dimension); for (z = 0; z < dimension; z++) { for (y = 0; y < dimension; y++) { for (x = 0; x < dimension; x++) { glPushMatrix(); glTranslatef(x, y, z); glScalef(0.8, 0.8, 0.8); for (i = 0; i < MAXQUAD; i++) draw_hidden(quads[i], mode); glPopMatrix(); } } } }
int KeyLineTexture::draw(CVIEWptr& v) { if (_ctrl) return _ctrl->draw(v); glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT); glDepthFunc(GL_LEQUAL); if (_patch->has_color()) set_color(_patch->color()); _solid->draw(v); if (_toon) _toon->draw(v); if (_show_hidden) draw_hidden(v); _sil_frame->draw(v); glPopAttrib(); return _patch->num_faces(); }