344
333
draw_tetra(ModeInfo * mi)
348
335
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
350
337
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
352
list = glGenLists(1);
353
glNewList(list, GL_COMPILE_AND_EXECUTE);
354
339
TRIANGLE(2, mp->seno, mp->edgedivisions, 0.5 / SQRT6, mp->VisibleSpikes);
358
342
glRotatef(180, 0, 0, 1);
359
343
glRotatef(-tetraangle, 1, 0, 0);
360
344
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
345
TRIANGLE(2, mp->seno, mp->edgedivisions, 0.5 / SQRT6, mp->VisibleSpikes);
364
348
glRotatef(180, 0, 1, 0);
365
349
glRotatef(-180 + tetraangle, 0.5, SQRT3 / 2, 0);
366
350
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
351
TRIANGLE(2, mp->seno, mp->edgedivisions, 0.5 / SQRT6, mp->VisibleSpikes);
369
353
glRotatef(180, 0, 1, 0);
370
354
glRotatef(-180 + tetraangle, 0.5, -SQRT3 / 2, 0);
371
355
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
374
glDeleteLists(list, 1);
356
TRIANGLE(2, mp->seno, mp->edgedivisions, 0.5 / SQRT6, mp->VisibleSpikes);
378
360
draw_cube(ModeInfo * mi)
382
362
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
385
364
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
387
list = glGenLists(1);
388
glNewList(list, GL_COMPILE_AND_EXECUTE);
389
366
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
392
368
glRotatef(cubeangle, 1, 0, 0);
393
369
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
370
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
395
371
glRotatef(cubeangle, 1, 0, 0);
396
372
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
373
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
398
374
glRotatef(cubeangle, 1, 0, 0);
399
375
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
376
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
401
377
glRotatef(cubeangle, 0, 1, 0);
402
378
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
379
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
404
380
glRotatef(2 * cubeangle, 0, 1, 0);
405
381
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
408
glDeleteLists(list, 1);
382
SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
412
386
draw_octa(ModeInfo * mi)
416
388
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
418
390
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
420
list = glGenLists(1);
421
glNewList(list, GL_COMPILE_AND_EXECUTE);
422
391
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
426
394
glRotatef(180, 0, 0, 1);
427
395
glRotatef(-180 + octaangle, 1, 0, 0);
428
396
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
397
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
432
400
glRotatef(180, 0, 1, 0);
433
401
glRotatef(-octaangle, 0.5, SQRT3 / 2, 0);
434
402
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
403
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
438
406
glRotatef(180, 0, 1, 0);
439
407
glRotatef(-octaangle, 0.5, -SQRT3 / 2, 0);
440
408
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
409
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
443
411
glRotatef(180, 1, 0, 0);
444
412
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
413
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
447
415
glRotatef(180, 0, 0, 1);
448
416
glRotatef(-180 + octaangle, 1, 0, 0);
449
417
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
418
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
453
421
glRotatef(180, 0, 1, 0);
454
422
glRotatef(-octaangle, 0.5, SQRT3 / 2, 0);
455
423
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
424
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
458
426
glRotatef(180, 0, 1, 0);
459
427
glRotatef(-octaangle, 0.5, -SQRT3 / 2, 0);
460
428
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
463
glDeleteLists(list, 1);
429
TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
467
433
draw_dodeca(ModeInfo * mi)
471
435
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
473
437
#define TAU ((SQRT5+1)/2)
475
439
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
477
list = glGenLists(1);
478
glNewList(list, GL_COMPILE_AND_EXECUTE);
479
441
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
483
444
glRotatef(180, 0, 0, 1);
485
446
glRotatef(-dodecaangle, 1, 0, 0);
486
447
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
448
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
490
451
glRotatef(-dodecaangle, cos72, sin72, 0);
491
452
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
453
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
495
456
glRotatef(-dodecaangle, cos72, -sin72, 0);
496
457
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
458
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
500
461
glRotatef(dodecaangle, cos36, -sin36, 0);
501
462
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
463
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
504
465
glRotatef(dodecaangle, cos36, sin36, 0);
505
466
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
467
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
508
469
glRotatef(180, 1, 0, 0);
509
470
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
471
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
511
472
glRotatef(180, 0, 0, 1);
513
474
glRotatef(-dodecaangle, 1, 0, 0);
514
475
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
476
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
518
479
glRotatef(-dodecaangle, cos72, sin72, 0);
519
480
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[8]);
481
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
523
484
glRotatef(-dodecaangle, cos72, -sin72, 0);
524
485
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[9]);
486
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
528
489
glRotatef(dodecaangle, cos36, -sin36, 0);
529
490
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[10]);
491
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
532
493
glRotatef(dodecaangle, cos36, sin36, 0);
533
494
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[11]);
536
glDeleteLists(list, 1);
495
PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
540
499
draw_icosa(ModeInfo * mi)
544
501
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
546
503
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
548
list = glGenLists(1);
549
glNewList(list, GL_COMPILE_AND_EXECUTE);
550
505
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
556
510
glRotatef(180, 0, 0, 1);
557
511
glRotatef(-icoangle, 1, 0, 0);
558
512
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
513
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
561
515
glRotatef(180, 0, 1, 0);
562
516
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
563
517
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
518
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
566
520
glRotatef(180, 0, 1, 0);
567
521
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
568
522
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
523
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
572
526
glRotatef(180, 0, 1, 0);
573
527
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
574
528
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
529
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
577
531
glRotatef(180, 0, 1, 0);
578
532
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
579
533
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
534
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
582
536
glRotatef(180, 0, 0, 1);
583
537
glRotatef(-icoangle, 1, 0, 0);
584
538
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
539
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
587
541
glRotatef(180, 0, 1, 0);
588
542
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
589
543
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
544
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
592
546
glRotatef(180, 0, 1, 0);
593
547
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
594
548
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[8]);
549
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
597
551
glRotatef(180, 0, 0, 1);
598
552
glRotatef(-icoangle, 1, 0, 0);
599
553
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[9]);
554
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
602
556
glRotatef(180, 1, 0, 0);
603
557
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[10]);
558
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
606
560
glRotatef(180, 0, 0, 1);
607
561
glRotatef(-icoangle, 1, 0, 0);
608
562
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[11]);
563
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
611
565
glRotatef(180, 0, 1, 0);
612
566
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
613
567
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[12]);
568
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
616
570
glRotatef(180, 0, 1, 0);
617
571
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
618
572
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[13]);
573
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
622
576
glRotatef(180, 0, 1, 0);
623
577
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
624
578
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[14]);
579
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
627
581
glRotatef(180, 0, 1, 0);
628
582
glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
629
583
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[15]);
584
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
632
586
glRotatef(180, 0, 0, 1);
633
587
glRotatef(-icoangle, 1, 0, 0);
634
588
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[16]);
589
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
637
591
glRotatef(180, 0, 1, 0);
638
592
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
639
593
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[17]);
594
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
642
596
glRotatef(180, 0, 1, 0);
643
597
glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
644
598
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[18]);
599
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
647
601
glRotatef(180, 0, 0, 1);
648
602
glRotatef(-icoangle, 1, 0, 0);
649
603
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[19]);
652
glDeleteLists(list, 1);
604
TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
656
reshape_morph3d(ModeInfo * mi, int width, int height)
608
reshape(ModeInfo * mi, int width, int height)
658
610
morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];