42 if (toupper(a[i]) != toupper(b[i])) {
53 fscanf(dfile,
"%s",data);
56 printf(
"parse: Expected %s, got %s \n",
string, data);
57 printf(
"Rendering terminated. \n");
65 fscanf(dfile,
"%f %f %f", &a, &b, &c);
77 if (nffname == NULL) {
81 dfile=fopen(nffname,
"r");
97 int raydepth, antialiasing;
98 int xres, yres, verbose;
100 float vangle, hither;
107 Cview.
x = lookat.
x - Ccenter.
x;
108 Cview.
y = lookat.
y - Ccenter.
y;
109 Cview.
z = lookat.
z - Ccenter.
z;
115 fscanf(dfile,
"%f", &vangle);
120 fscanf(dfile,
"%f", &hither);
123 fscanf(dfile,
"%d %d", &xres, &yres);
134 Ccenter, Cview, Cup);
144 fscanf(dfile,
"%f %f %f", &r, &g, &b);
163 fscanf(dfile,
"%f %f %f", &r, &g, &b);
175 float r, g, b, Kd, Ks, Shine, T, IOR;
177 fscanf(dfile,
"%f %f %f %f %f %f %f %f",
178 &r, &g, &b, &Kd, &Ks, &Shine, &T, &IOR);
185 tex.
opacity = (T > 0.99) ? 0.0 : (1.0 - T);
196 float baserad, apexrad;
199 fscanf(dfile,
"%f", &baserad);
202 fscanf(dfile,
"%f", &apexrad);
205 axis.
x=pnt2.
x - pnt1.
x;
206 axis.
y=pnt2.
y - pnt1.
y;
207 axis.
z=pnt2.
z - pnt1.
z;
221 fscanf(dfile,
"%f", &a);
233 fscanf(dfile,
"%d", &numverts);
237 for (i=2; i<numverts; i++) {
252 fscanf(dfile,
"%d", &numverts);
258 for (i=2; i<numverts; i++) {
271 if (fscanf(dfile,
"%s", objtype) != 1)
float g
Green color component.
void rt_camera_setup(SceneHandle voidscene, flt zoom, flt aspectratio, int antialiasing, int raydepth, apivector camcent, apivector viewvec, apivector upvec)
Define a camera for a perspective projection, given the specified zoom factor, aspect ratio...
float r
Red color component.
void * rt_texture(SceneHandle sc, apitexture *apitex)
Translate a texture definition into the internal format used by Tachyon, and returns an opaque pointe...
apicolor col
base object color
int NFFGetObject(FILE *dfile, SceneHandle scene)
void rt_resolution(SceneHandle voidscene, int hres, int vres)
Set the horizontal and vertical resolution (in pixels) for the specified scene.
flt diffuse
diffuse reflection
flt opacity
how opaque the object is
flt specular
specular reflection
void NFFGetVector(FILE *dfile, apivector *v1)
void rt_sphere(SceneHandle scene, void *tex, apivector ctr, flt rad)
Define a sphere with associated texture, center, and radius.
int NFFGetCylCone(FILE *dfile, SceneHandle scene)
int NFFGetScenedefs(FILE *dfile, SceneHandle scene)
void rt_tri(SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2)
Define a flat-shaded triangle.
flt x
X coordinate or direction component.
flt apiflt
for backward compatibility
flt y
Y coordinate or direction component.
void rt_fcylinder(SceneHandle scene, void *tex, apivector ctr, apivector axis, flt rad)
Define a finite-length cylinder.
void rt_outputfile(SceneHandle voidscene, const char *outname)
Set the filename for the output image for the specified scene.
int NFFGetLight(FILE *dfile, SceneHandle scene)
int NFFGetPolygon(FILE *dfile, SceneHandle scene)
int NFFGetSphere(FILE *dfile, SceneHandle scene)
void rt_stri(SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2, apivector n0, apivector n1, apivector n2)
Define a smooth-shaded triangle using interpolated vertex normals.
int texturefunc
which texture function to use
flt ambient
ambient lighting
void rt_background(SceneHandle voidscene, apicolor col)
Set the background color of the specified scene.
int NFFGetPatch(FILE *dfile, SceneHandle scene)
float b
Blue color component.
int NFFGetTexture(FILE *dfile, SceneHandle scene)
unsigned int ParseNFF(char *nffname, SceneHandle scene)
void NFFGetString(FILE *dfile, char *string)
Tachyon public API function prototypes and declarations used to drive the ray tracing engine...
int NFFstringcmp(char *a, char *b)
void * rt_light(SceneHandle voidscene, void *tex, apivector ctr, flt rad)
Define a point light with associated texture, position, and radius.
flt z
Z coordinate or direction component.
void rt_verbose(SceneHandle voidscene, int v)
Enables or Disables verbose messages from the Tachyon library during rendering.
int NFFGetBackground(FILE *dfile, SceneHandle scene)