1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| BOOL DrawCuboid(double x, double y, double z) {
double cx = x/2.0; double cy = y/2.0; double cz = z/2.0; glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex3f(-cx, -cy, -cz); glTexCoord2f(1.0f, 0.0f); glVertex3f(-cx, cy, -cz); glTexCoord2f(1.0f, 1.0f); glVertex3f(-cx, cy, cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(-cx, -cy, cz); glTexCoord2f(0.0f, 0.0f); glVertex3f(cx, -cy, -cz); glTexCoord2f(1.0f, 0.0f); glVertex3f(cx, cy, -cz); glTexCoord2f(1.0f, 1.0f); glVertex3f(cx, cy, cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(cx, -cy, cz); glTexCoord2f(0.0f, 0.0f); glVertex3f(-cx, cy, -cz); glTexCoord2f(1.0f, 0.0f); glVertex3f( cx, cy, -cz); glTexCoord2f(1.0f, 1.0f); glVertex3f( cx, cy, cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(-cx, cy, cz); glTexCoord2f(0.0f, 0.0f); glVertex3f(-cx, -cy, -cz); glTexCoord2f(1.0f, 0.0f); glVertex3f( cx, -cy, -cz); glTexCoord2f(1.0f, 1.0f); glVertex3f( cx, -cy, cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(-cx, -cy, cz); glTexCoord2f(0.0f, 0.0f); glVertex3f(-cx, -cy, -cz); glTexCoord2f(1.0f, 0.0f); glVertex3f( cx, -cy, -cz); glTexCoord2f(1.0f, 1.0f); glVertex3f( cx, cy, -cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(-cx, cy, -cz); glTexCoord2f(0.0f, 0.0f); glVertex3f(-cx, -cy, cz); glTexCoord2f(1.0f, 0.0f); glVertex3f( cx, -cy, cz); glTexCoord2f(1.0f, 1.0f); glVertex3f( cx, cy, cz); glTexCoord2f(0.0f, 1.0f); glVertex3f(-cx, cy, cz); glEnd();
return TRUE; }
|