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 >
Wrap
Text File
|
1991-10-14
|
1KB
|
46 lines
#include "solid.h"
void show_scene()
/* Traverses all object and facet descriptors. */
{
struct solid_obj *obj_ptr;
struct facet *facet_ptr;
int vertex_ref_index, facet_index;
float tmp;
obj_ptr = obj_first;
while (obj_ptr != (struct solid_obj *)NULL) {
/* loop for each object */
transform_object(obj_ptr);
obj_ptr = obj_ptr->obj_next;
}
/* adjust screen coordinates for border */
tmp = screen_x_min - border * (screen_x_max -
screen_x_min);
screen_x_max += border * (screen_x_max -
screen_x_min);
screen_x_min = tmp;
tmp = screen_y_min - border * (screen_y_max -
screen_y_min);
screen_y_max += border * (screen_y_max -
screen_y_min);
screen_y_min = tmp;
obj_ptr = obj_first;
while (obj_ptr != (struct solid_obj *)NULL) {
/* loop for each object */
for (facet_ptr = defn_ptr[obj_ptr->obj_type]->
facet_first, facet_index = 0; facet_index <
defn_ptr[obj_ptr->obj_type]->facet_count;
++facet_index) { /* loop for each facet */
display_facet(obj_ptr, facet_ptr, TRUE,
obj_ptr->visible[facet_index]);
/* project and display facet */
facet_ptr = ADV_FACET_PTR(facet_ptr->
vertex_count);
}
obj_ptr = obj_ptr->obj_next;
}
}