--- ray/src/hd/rhd_glx.c 1997/12/26 14:12:37 3.4 +++ ray/src/hd/rhd_glx.c 1997/12/30 16:59:46 3.9 @@ -100,6 +100,7 @@ char *id; XSizeHints oursizhints; /* set quadtree globals */ qtMinNodesiz = 3; + qtDepthEps = 0.07; /* open display server */ ourdisplay = XOpenDisplay(NULL); if (ourdisplay == NULL) @@ -161,9 +162,8 @@ char *id; /* map the window */ XMapWindow(ourdisplay, gwind); dev_input(); /* sets size and view angles */ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* allocate our leaf pile */ - if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) * + if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * DisplayHeight(ourdisplay,ourscreen) / (qtMinNodesiz*qtMinNodesiz))) error(SYSTEM, "insufficient memory for value storage"); @@ -284,7 +284,7 @@ double rad; else apexh = 1. - ip[2]/(curzmax*DEPTHFACT); } - /* find closest cone match */ + rad *= 1.25; /* find conservative cone match */ for (ci = 0; ci < MAXCONE-1; ci++) if (cone[ci].rad >= rad) break; @@ -567,12 +567,20 @@ register XKeyPressedEvent *ekey; inpresflags |= DFL(DC_RESUME); return; case CTRL('R'): /* redraw screen */ + if (nxtzmax > FTINY) { + curzmax = nxtzmax; + nxtzmax = 0.; + } glClear(GL_DEPTH_BUFFER_BIT); qtRedraw(0, 0, odev.hres, odev.vres); return; case CTRL('L'): /* refresh from server */ if (inpresflags & DFL(DC_REDRAW)) return; + if (nxtzmax > FTINY) { + curzmax = nxtzmax; + nxtzmax = 0.; + } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); draw_grids(); glFlush(); @@ -627,6 +635,8 @@ static resizewindow(ersz) /* resize window */ register XConfigureEvent *ersz; { + glViewport(0, 0, ersz->width, ersz->height); + if (ersz->width == odev.hres && ersz->height == odev.vres) return; @@ -635,8 +645,6 @@ register XConfigureEvent *ersz; odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); - - glViewport(0, 0, odev.hres, odev.vres); inpresflags |= DFL(DC_SETVIEW); }