--- ray/src/hd/rhd_ogl.c 1999/01/01 10:41:28 3.13 +++ ray/src/hd/rhd_ogl.c 1999/07/19 20:15:16 3.18 @@ -22,7 +22,6 @@ static char SCCSid[] = "$SunId$ SGI"; #include "standard.h" -#include #include #include #ifdef STEREO @@ -39,6 +38,16 @@ static char SCCSid[] = "$SunId$ SGI"; #ifndef RAYQLEN #define RAYQLEN 0 /* max. rays to queue before flush */ #endif +#ifndef MINWIDTH +#define MINWIDTH 480 /* minimum graphics window width */ +#define MINHEIGHT 400 /* minimum graphics window height */ +#endif +#ifndef VIEWDIST +#define VIEWDIST 356 /* assumed viewing distance (mm) */ +#endif +#ifndef BORWIDTH +#define BORWIDTH 5 /* border width */ +#endif #ifndef FEQ #define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) @@ -60,13 +69,6 @@ static char SCCSid[] = "$SunId$ SGI"; #define MOVDEG (-5) /* degrees to orbit CW/down /frame */ #define MOVORB(s) ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0) -#define MINWIDTH 480 /* minimum graphics window width */ -#define MINHEIGHT 400 /* minimum graphics window height */ - -#define VIEWDIST 356 /* assumed viewing distance (mm) */ - -#define BORWIDTH 5 /* border width */ - #define setstereobuf(bid) (glXWaitGL(), \ XSGISetStereoBuffer(ourdisplay, gwind, bid), \ glXWaitX()) @@ -331,14 +333,14 @@ register VIEW *nv; dev_input(); /* get resize event */ } copystruct(&odev.v, nv); /* setview() already called */ -#ifdef STEREO - copystruct(&vwright, nv); - d = eyesepdist / sqrt(nv->hn2); - VSUM(vwright.vp, nv->vp, nv->hvec, d); - /* setview(&vwright); -- Unnecessary */ -#endif viewflags |= VWCHANGE; } +#ifdef STEREO + copystruct(&vwright, nv); + d = eyesepdist / sqrt(nv->hn2); + VSUM(vwright.vp, nv->vp, nv->hvec, d); + /* setview(&vwright); -- Unnecessary */ +#endif wipeclean(); return(1); } @@ -865,8 +867,8 @@ setglpersp() /* set perspective view in GL */ dev_zmin = odev.v.vfore; if (odev.v.vaft > FTINY) dev_zmax = odev.v.vaft; - if (dev_zmin < dev_zmax/100.) - dev_zmin = dev_zmax/100.; + if (dev_zmin*500. < dev_zmax) + dev_zmax = dev_zmin*500.; setzrat(); xmax = dev_zmin * tan(PI/180./2. * odev.v.horiz); xmin = -xmax; @@ -942,7 +944,7 @@ wipeclean() /* prepare for redraw */ viewflags &= ~VWCHANGE; /* change noted */ } else if (viewflags & VWSTEADY) odRedrawAll(); - setglpersp(&odev.v); /* reset view & clipping planes */ + setglpersp(); /* reset view & clipping planes */ }