home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
p
/
ply15dat.zip
/
LIB.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-15
|
3KB
|
80 lines
/*
* lib.h - vector library definitions
*
* Version: 2.2 (11/17/87)
* Author: Eric Haines, 3D/Eye, Inc.
*
* Modified: 1 October 1992
* Alexander R. Enzmann
*/
/* Change this to "PARAMS(x) ()" if your compiler can't handle function
prototyping */
#ifndef PARAMS
#define PARAMS(x) x
#endif
#define OUTPUT_VIDEO 0
#define OUTPUT_NFF 1
#define OUTPUT_POVRAY 2
#define OUTPUT_POLYRAY 3
#define OUTPUT_VIVID 4
#define OUTPUT_QRT 5
#define OUTPUT_RAYSHADE 6
#define OUTPUT_POVRAY_15 7
#define X_AXIS 0
#define Y_AXIS 1
#define Z_AXIS 2
/* Output library definitions */
#define OUTPUT_CURVES 0 /* true curve output */
#define OUTPUT_PATCHES 1 /* polygonal patches output */
#define OUTPUT_RESOLUTION 4 /* default amount of polygonalization */
/* Basic math functions */
void lib_zero_matrix PARAMS((MATRIX mx));
void lib_create_identity_matrix PARAMS((MATRIX mx));
void lib_create_translate_matrix PARAMS((MATRIX mx, COORD4 *vec));
void lib_create_scale_matrix PARAMS((MATRIX mx, COORD4 *vec));
void lib_create_rotate_matrix PARAMS((MATRIX mx, int axis, double angle));
void lib_create_axis_rotate_matrix PARAMS((MATRIX mx, COORD4 *rvec,
double angle));
void lib_create_canonical_matrix PARAMS((MATRIX trans, MATRIX itrans,
COORD4 *origin, COORD4 *up));
void lib_create_view_transform PARAMS((COORD4 *from, COORD4 *at, COORD4 *up,
MATRIX T));
void lib_transform_coord PARAMS((COORD4 *vres, COORD4 *vec, MATRIX mx));
void lib_matrix_multiply PARAMS((MATRIX mxres, MATRIX mx1, MATRIX mx2));
void lib_rotate_cube_face PARAMS((COORD4 *vec, int major_axis, int mod_face));
double lib_normalize_coord3 PARAMS((COORD4 *cvec));
double lib_gauss_rand PARAMS((long iseed));
/* Library setup for IO functions */
void lib_set_output_file PARAMS((FILE *new_outfile));
void lib_set_default_texture PARAMS((char *default_texture));
void lib_set_raytracer PARAMS((int default_tracer));
void lib_set_polygonalization PARAMS((int u_steps, int v_steps));
/* Scene/object generation functions */
void lib_output_viewpoint PARAMS((COORD4 *from, COORD4 *at, COORD4 *up,
double fov_angle, double aspect_ratio,
double hither, int resx, int resy));
void lib_output_light PARAMS((COORD4 *center_pt));
void lib_output_background_color PARAMS((COORD4 *color));
char *lib_output_color PARAMS((COORD4 *color, double ka, double kd, double ks,
double shine, double ang,
double t, double i_of_r));
void lib_output_cylcone PARAMS((COORD4 *base_pt, COORD4 *apex_pt,
int curve_format));
void lib_output_sphere PARAMS((COORD4 *center_pt, int curve_format));
void lib_output_torus PARAMS((COORD4 *center, COORD4 *normal,
double iradius, double oradius,
int curve_format));
void lib_output_box PARAMS((COORD4 *point1, COORD4 *point2));
void lib_output_polygon PARAMS((int tot_vert, COORD4 *vert));
void lib_output_polypatch PARAMS((int tot_vert, COORD4 *vert, COORD4 *norm));
void lib_output_sq_sphere PARAMS((COORD4 *center_pt, double a1, double a2,
double a3, double n, double e));