#include #include #include #include #include #include #include #include #include #include "globals.h" #include "util.h" #include "lights.h" #include "states.h" #include "geom.h" #include "init.h" /* initial WINDOW parameters */ #define WIN_LEFT 100 #define WIN_WIDTH 500 #define WIN_BOTTOM 300 #define WIN_HEIGHT 500 /* sets up the menus and windows, initializes all of the variables, globals variables, states of the event handler and renderer, and sets up the viewing perspective. also handles the arguements */ void Initialize(int argc, char *argv[]) { int i; Colorindex dummy = 0; if (argc < 1) { fprintf(stderr, "USAGE: %s\n", argv[0]); exit(-1); } init_event_state(&gevents); init_render_state(&gstate); gstate.scale_factor = 1.0; gstate.shading = GOURAUD; gstate.persp = 1; gstate.aspect_on = 1; gstate.zbuffer_on = 1; gstate.alpha_on = 1; gstate.lights_on = 1; gstate.left = -1.0; gstate.right = 1.0; gstate.bottom = -1.0; gstate.top = 1.0; gstate.near = 0.01; gstate.far = 100.0; gstate.angle = 450.0; gstate.twist = 0.0; Point(gstate.cop, 0.0, 0.0, 5.0); Point(gstate.dcop, 0.0, 0.0, 0.0); Point(gstate.vrp, 0.0, 0.0, 0.0); Point(gstate.dvrp, 0.0, 0.0, 0.0); gstate.theta = get_theta(gstate.cop, gstate.vrp); gstate.phi = get_phi(gstate.cop, gstate.vrp, gstate.theta); gstate.cv_rad = distance(gstate.cop, gstate.vrp); gstate.sensitivity = 1.0; gstate.backface_on = 1; gstate.concave_on = 1; gstate.twoside = 0.0; gstate.eye_sep = 0.25; image_file = "TILES/tex0.rgb"; gstate.axis = NO_AXIS; cursor_type = finger; gstate.timeout = 5; gstate.auto_rotate = 0; gstate.auto_wobble = 0; gstate.wobble_amplitude = 10.0; gstate.wobble_period = 10.0; /* background info */ gstate.bg_file = "BKGRND/sunset.rgb"; gstate.bg_on = 0; gstate.dither_on = 0; /* parse the arguments */ for (i=1; i