home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / IRIT / IRITS.ZIP / AMBIGUIT.IRT < prev    next >
Encoding:
Text File  |  1990-05-05  |  901 b   |  41 lines

  1. #
  2. # The most common example of wireframe ambiguity. See for example:
  3. # Geometric Modeling by Michael E. Mortenson, page 4...
  4. #
  5.  
  6. save_res = resolution;
  7. save_view = view_mat;
  8.  
  9. view_mat = view_mat * scale(vector(0.6, 0.6, 0.6)) * rotx(30) * roty(20);
  10.  
  11. A = box(vector(-0.5, -0.5, -0.55), 1.0, 1.0, 1.1);
  12.  
  13. resolution = 4;            # To create 4 sided pyramids from cones...
  14. C1 = cone(vector(0.0, 0.0, -0.6), vector(0.0, 0.0,  0.6), 0.6 * sqrt(2.0)) *
  15.     rotz(45);
  16. C2 = cone(vector(0.0, 0.0,  0.6), vector(0.0, 0.0, -0.6), 0.6 * sqrt(2.0)) *
  17.     rotz(45);
  18.  
  19. A = A - C1 - C2;
  20. free(C1);
  21. free(C2);
  22. view(list(A), 1);
  23.  
  24. B = box(vector(-0.3, -0.3, -1.0), 0.6, 0.6, 2.0);
  25. C = A - B;
  26. free(A);
  27. free(B);
  28.  
  29. final = convex(C);
  30. free(C);
  31.  
  32. beep(1000,100);
  33. interact(list(final), 0);
  34.  
  35. mdump("ambiguit", view_mat);
  36. gdump("ambiguit", final);
  37. free(final);
  38.  
  39. view_mat = save_view;
  40. resolution = save_res;
  41.