156
156
#define PlankThickness 0.15
159
draw_woodplank(cagestruct * cp)
159
draw_woodplank(cagestruct * cp, int wire)
161
glBegin(wire ? GL_LINES : GL_QUADS);
162
162
glNormal3f(0, 0, 1);
163
163
glTexCoord2f(0, 0);
164
164
glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
222
draw_impossiblecage(cagestruct * cp)
222
draw_impossiblecage(cagestruct * cp, int wire)
225
225
glRotatef(90, 0, 1, 0);
226
226
glTranslatef(0.0, PlankHeight - PlankWidth, -PlankThickness - PlankWidth);
227
if (!draw_woodplank(cp))
227
if (!draw_woodplank(cp, wire))
231
231
glRotatef(90, 0, 0, 1);
232
232
glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - PlankThickness);
233
if (!draw_woodplank(cp))
233
if (!draw_woodplank(cp, wire))
237
237
glRotatef(90, 0, 1, 0);
238
238
glTranslatef(0.0, PlankWidth - PlankHeight, -PlankThickness - PlankWidth);
239
if (!draw_woodplank(cp))
239
if (!draw_woodplank(cp, wire))
243
243
glTranslatef(0.0, PlankWidth - PlankHeight, 3 * PlankThickness - PlankWidth);
244
if (!draw_woodplank(cp))
244
if (!draw_woodplank(cp, wire))
248
248
glRotatef(90, 0, 0, 1);
249
249
glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - PlankThickness);
250
if (!draw_woodplank(cp))
250
if (!draw_woodplank(cp, wire))
254
254
glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - 3 * PlankThickness);
255
if (!draw_woodplank(cp))
255
if (!draw_woodplank(cp, wire))
259
259
glTranslatef(0.0, PlankHeight - PlankWidth, 3 * PlankThickness - PlankWidth);
260
if (!draw_woodplank(cp))
260
if (!draw_woodplank(cp, wire))
264
264
glRotatef(90, 0, 0, 1);
265
265
glTranslatef(0.0, PlankHeight - PlankWidth, PlankThickness - PlankWidth);
266
if (!draw_woodplank(cp))
266
if (!draw_woodplank(cp, wire))
270
270
glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - 3 * PlankThickness);
271
if (!draw_woodplank(cp))
271
if (!draw_woodplank(cp, wire))
275
275
glRotatef(90, 0, 1, 0);
276
276
glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth + PlankThickness);
277
if (!draw_woodplank(cp))
277
if (!draw_woodplank(cp, wire))
281
281
glRotatef(90, 0, 0, 1);
282
282
glTranslatef(0.0, PlankWidth - PlankHeight, PlankThickness - PlankWidth);
283
if (!draw_woodplank(cp))
283
if (!draw_woodplank(cp, wire))
287
287
glRotatef(90, 0, 1, 0);
288
288
glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth + PlankThickness);
289
if (!draw_woodplank(cp))
289
if (!draw_woodplank(cp, wire))
312
312
pinit(ModeInfo *mi)
315
316
glClearDepth(1.0);
316
317
glClearColor(0.0, 0.0, 0.0, 1.0);
319
if (MI_IS_WIREFRAME(mi))
318
322
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
319
323
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
320
324
glLightfv(GL_LIGHT0, GL_POSITION, position0);
440
444
glRotatef(cp->step * 100, 0, 0, 1);
441
445
glRotatef(25 + cos(cp->step * 5) * 6, 1, 0, 0);
442
446
glRotatef(204.5 - sin(cp->step * 5) * 8, 0, 1, 0);
443
if (!draw_impossiblecage(cp)) {
447
if (!draw_impossiblecage(cp, MI_IS_WIREFRAME(mi))) {
444
448
release_cage(mi);