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

  1. #
  2. # This solid uses free form surfaces to create a rolling-pin. Note that
  3. # A polygon loaded without its plane definition, its plane normal (point into
  4. # the object) is set by the cross product of its first two edges. You might
  5. # need to flip them (using the unary minus - overloaded above geometric
  6. # objects to perform exactly that) sometimes.
  7. #
  8. #                Created by Gershon Elber,    Mar 89
  9.  
  10. tm = time(true);
  11.  
  12. save_mat = view_mat;
  13. save_res = resolution;
  14.  
  15. # normal(TRUE, 0.1, YELLOW);
  16.  
  17. resolution = 20;
  18.  
  19. T1 = load("surface1");
  20. T2 = T1 * rotx(180);
  21. interact(list(T1, T2), false);
  22.  
  23. T3 = cylin( vector(0.0, 0.0, -2.0), vector(0.0, 0.0, 4.0), 0.12);
  24. view(list(T3), false);
  25.  
  26. S1 = T3 * T2 * T1;
  27. free(T1);
  28. free(T2);
  29. free(T3);
  30.  
  31. final = convex(S1);
  32. free(S1);
  33.  
  34. tm = time(false);
  35. tm; # In Seconds
  36.  
  37. interact(list(final), false);
  38.  
  39. mdump("solid5", view_mat);
  40. gdump("solid5", final);
  41.  
  42. view_mat = save_mat;
  43. resolution = save_res;