| 8 |
|
* Program to display Radiance scene using OpenGL. |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
– |
#include "radogl.h" |
| 12 |
– |
#include "view.h" |
| 13 |
– |
#include "paths.h" |
| 11 |
|
#include <sys/types.h> |
| 12 |
|
#include <GL/glx.h> |
| 13 |
|
#ifndef NOSTEREO |
| 14 |
|
#include <X11/extensions/SGIStereo.h> |
| 15 |
|
#endif |
| 16 |
|
#include <ctype.h> |
| 17 |
+ |
#include "radogl.h" |
| 18 |
+ |
#include "view.h" |
| 19 |
+ |
#include "paths.h" |
| 20 |
|
#include "glradicon.h" |
| 21 |
|
|
| 22 |
|
#ifndef MAXVIEW |
| 161 |
|
dev_open(radfile = argv[i]); |
| 162 |
|
/* load octree or scene files */ |
| 163 |
|
if (octree != NULL) { |
| 164 |
< |
displist = rgl_octlist(octree, NULL, NULL); |
| 164 |
> |
displist = rgl_octlist(octree, NULL, NULL, NULL); |
| 165 |
|
startrtrace(octree); |
| 166 |
|
} else |
| 167 |
< |
displist = rgl_filelist(nscenef, scene); |
| 167 |
> |
displist = rgl_filelist(nscenef, scene, NULL); |
| 168 |
|
/* set initial view */ |
| 169 |
|
dev_view(currentview < 0 ? &thisview : vwl[currentview].v); |
| 170 |
|
/* input/render loop */ |
| 173 |
|
/* all done */ |
| 174 |
|
quit(0); |
| 175 |
|
userr: |
| 176 |
< |
fprintf(stderr, "Usage: %s [-w][-b][-v view] rfile [VAR=value]..\n", |
| 176 |
> |
fprintf(stderr, |
| 177 |
> |
"Usage: %s [-w][-s][-b][-S][-v view] rfile [VAR=value]..\n", |
| 178 |
|
argv[0]); |
| 179 |
|
quit(1); |
| 180 |
|
} |
| 298 |
|
atof(sskip2(buf+4,1)), |
| 299 |
|
atof(sskip2(buf+4,2))); |
| 300 |
|
else if (backvis && !strncmp(buf, "-bv", 3) && |
| 301 |
< |
(!buf[3] || strchr(" 0-FfNn", buf[3]) != NULL)) |
| 301 |
> |
(!buf[3] || strchr("0-FfNn \n",buf[3])!=NULL)) |
| 302 |
|
backvis = 0; |
| 303 |
|
fclose(fp); |
| 304 |
|
unlink(optfile); /* delete options file */ |
| 424 |
|
glDepthFunc(GL_LESS); |
| 425 |
|
glShadeModel(GL_SMOOTH); |
| 426 |
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); |
| 427 |
< |
glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); |
| 427 |
> |
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); |
| 428 |
|
glEnable(GL_LIGHTING); |
| 429 |
+ |
glFrontFace(GL_CCW); |
| 430 |
+ |
glCullFace(GL_BACK); |
| 431 |
|
if (backvis) |
| 432 |
|
glDisable(GL_CULL_FACE); |
| 433 |
< |
else { |
| 431 |
< |
glFrontFace(GL_CCW); |
| 432 |
< |
glCullFace(GL_BACK); |
| 433 |
> |
else |
| 434 |
|
glEnable(GL_CULL_FACE); |
| 434 |
– |
} |
| 435 |
|
glDrawBuffer(GL_BACK); |
| 436 |
|
/* figure out sensible view */ |
| 437 |
|
pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) / |
| 809 |
|
; |
| 810 |
|
else if (vwnum >= MAXVIEW || vwl[vwnum].v == NULL) |
| 811 |
|
vwnum = 0; |
| 812 |
– |
if (vwnum == currentview) |
| 813 |
– |
return; |
| 812 |
|
copylastv("standard view"); |
| 813 |
|
dev_view(vwl[currentview=vwnum].v); |
| 814 |
|
} |