| 36 |
|
* as simple as we can. Global variables and their defaults |
| 37 |
|
* are defined below, and including "ray.h" declares these |
| 38 |
|
* along with all the routines you are likely to need. First, |
| 39 |
< |
* assign the global variable progname to your argv[0], then |
| 40 |
< |
* change the rendering parameters as you like. If you have a set |
| 41 |
< |
* of option arguments you are working from, the getrenderopt(ac,av) |
| 39 |
> |
* assign the global variable progname by calling fixargv0(argv[0]), |
| 40 |
> |
* then change the rendering parameters as you like. If you have a |
| 41 |
> |
* set of option arguments you are working from, the getrenderopt() |
| 42 |
|
* call should be very useful. Before tracing any rays, you |
| 43 |
|
* must read in the octree with a call to ray_init(oct). |
| 44 |
|
* Passing NULL for the file name causes ray_init() to read |
| 98 |
|
#include "ambient.h" |
| 99 |
|
#include "otypes.h" |
| 100 |
|
#include "random.h" |
| 101 |
+ |
#include "func.h" |
| 102 |
|
#include "data.h" |
| 103 |
|
#include "font.h" |
| 104 |
|
#include "pmapray.h" |
| 105 |
|
|
| 105 |
– |
char *progname = "unknown_app"; /* caller sets to argv[0] */ |
| 106 |
– |
|
| 106 |
|
char *octname; /* octree name we are given */ |
| 107 |
|
|
| 109 |
– |
char *shm_boundary = NULL; /* boundary of shared memory */ |
| 110 |
– |
|
| 108 |
|
CUBE thescene; /* our scene */ |
| 109 |
|
OBJECT nsceneobjs; /* number of objects in our scene */ |
| 110 |
|
|
| 111 |
|
int dimlist[MAXDIM]; /* sampling dimensions */ |
| 112 |
|
int ndims = 0; /* number of sampling dimensions */ |
| 113 |
< |
int samplendx = 0; /* index for this sample */ |
| 113 |
> |
unsigned long samplendx = 0; /* index for this sample */ |
| 114 |
|
|
| 115 |
|
void (*trace)() = NULL; /* trace call */ |
| 116 |
|
|
| 155 |
|
int ambincl = -1; /* include == 1, exclude == 0 */ |
| 156 |
|
|
| 157 |
|
|
| 158 |
< |
static void |
| 158 |
> |
void |
| 159 |
|
reset_random(void) /* re-initialize random number generator */ |
| 160 |
|
{ |
| 161 |
|
if (rand_samp) { |
| 178 |
|
/* initialize object types */ |
| 179 |
|
if (ofun[OBJ_SPHERE].funp == o_default) |
| 180 |
|
initotypes(); |
| 181 |
+ |
/* initialize calcomp routines */ |
| 182 |
+ |
initfunc(); |
| 183 |
|
/* initialize urand */ |
| 184 |
|
reset_random(); |
| 185 |
+ |
/* initialize spectral sampling */ |
| 186 |
+ |
if (setspectrsamp(CNDX, WLPART) < 0) |
| 187 |
+ |
error(USER, "unsupported spectral sampling"); |
| 188 |
|
|
| 189 |
|
octname = savqstr(otnm); /* read scene octree */ |
| 190 |
|
readoct(octname, ~(IO_FILES|IO_INFO), &thescene, NULL); |