home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_12 / 9n12050a < prev    next >
Text File  |  1991-10-14  |  1KB  |  46 lines

  1. #include "solid.h"
  2.  
  3. void show_scene()
  4. /*  Traverses all object and facet descriptors. */
  5. {
  6.     struct solid_obj *obj_ptr;
  7.     struct facet *facet_ptr;
  8.     int vertex_ref_index, facet_index;
  9.     float tmp;
  10.  
  11.     obj_ptr = obj_first;
  12.     while (obj_ptr != (struct solid_obj *)NULL) {
  13.         /* loop for each object */
  14.         transform_object(obj_ptr);
  15.         obj_ptr = obj_ptr->obj_next;
  16.     }
  17.  
  18.     /* adjust screen coordinates for border */
  19.     tmp = screen_x_min - border * (screen_x_max -
  20.         screen_x_min);
  21.     screen_x_max += border * (screen_x_max -
  22.          screen_x_min);
  23.     screen_x_min = tmp;
  24.     tmp = screen_y_min - border * (screen_y_max -
  25.         screen_y_min);
  26.     screen_y_max += border * (screen_y_max -
  27.          screen_y_min);
  28.     screen_y_min = tmp;
  29.  
  30.     obj_ptr = obj_first;
  31.     while (obj_ptr != (struct solid_obj *)NULL) {
  32.         /* loop for each object */
  33.         for (facet_ptr = defn_ptr[obj_ptr->obj_type]->
  34.             facet_first, facet_index = 0; facet_index <
  35.             defn_ptr[obj_ptr->obj_type]->facet_count;
  36.             ++facet_index) { /* loop for each facet */
  37.             display_facet(obj_ptr, facet_ptr, TRUE,
  38.                 obj_ptr->visible[facet_index]);
  39.                 /* project and display facet */
  40.             facet_ptr = ADV_FACET_PTR(facet_ptr->
  41.                 vertex_count);
  42.         }
  43.         obj_ptr = obj_ptr->obj_next;
  44.     }
  45. }
  46.