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 >
C/C++ Source or Header  |  1992-10-15  |  3KB  |  80 lines

  1. /*
  2.  * lib.h - vector library definitions
  3.  *
  4.  * Version:  2.2 (11/17/87)
  5.  * Author:  Eric Haines, 3D/Eye, Inc.
  6.  *
  7.  * Modified: 1 October 1992
  8.  *           Alexander R. Enzmann
  9.  */
  10.  
  11. /* Change this to "PARAMS(x) ()" if your compiler can't handle function 
  12.    prototyping */
  13. #ifndef PARAMS
  14. #define PARAMS(x) x
  15. #endif
  16.  
  17. #define OUTPUT_VIDEO     0
  18. #define OUTPUT_NFF       1
  19. #define OUTPUT_POVRAY    2
  20. #define OUTPUT_POLYRAY   3
  21. #define OUTPUT_VIVID     4
  22. #define OUTPUT_QRT       5
  23. #define OUTPUT_RAYSHADE  6
  24. #define OUTPUT_POVRAY_15 7
  25.  
  26. #define X_AXIS  0
  27. #define Y_AXIS  1
  28. #define Z_AXIS  2
  29.  
  30. /* Output library definitions */
  31. #define OUTPUT_CURVES           0       /* true curve output */
  32. #define OUTPUT_PATCHES          1       /* polygonal patches output */
  33.  
  34. #define OUTPUT_RESOLUTION       4       /* default amount of polygonalization */
  35.  
  36. /* Basic math functions */
  37. void lib_zero_matrix PARAMS((MATRIX mx));
  38. void lib_create_identity_matrix PARAMS((MATRIX mx));
  39. void lib_create_translate_matrix PARAMS((MATRIX mx, COORD4 *vec));
  40. void lib_create_scale_matrix PARAMS((MATRIX mx, COORD4 *vec));
  41. void lib_create_rotate_matrix PARAMS((MATRIX mx, int axis, double angle));
  42. void lib_create_axis_rotate_matrix PARAMS((MATRIX mx, COORD4 *rvec,
  43.                        double angle));
  44. void lib_create_canonical_matrix PARAMS((MATRIX trans, MATRIX itrans,
  45.                      COORD4 *origin, COORD4 *up));
  46. void lib_create_view_transform PARAMS((COORD4 *from, COORD4 *at, COORD4 *up,
  47.                        MATRIX T));
  48. void lib_transform_coord PARAMS((COORD4 *vres, COORD4 *vec, MATRIX mx));
  49. void lib_matrix_multiply PARAMS((MATRIX mxres, MATRIX mx1, MATRIX mx2));
  50. void lib_rotate_cube_face PARAMS((COORD4 *vec, int major_axis, int mod_face));
  51. double lib_normalize_coord3 PARAMS((COORD4 *cvec));
  52. double lib_gauss_rand PARAMS((long iseed));
  53.  
  54. /* Library setup for IO functions */
  55. void lib_set_output_file PARAMS((FILE *new_outfile));
  56. void lib_set_default_texture PARAMS((char *default_texture));
  57. void lib_set_raytracer PARAMS((int default_tracer));
  58. void lib_set_polygonalization PARAMS((int u_steps, int v_steps));
  59.  
  60. /* Scene/object generation functions */
  61. void lib_output_viewpoint PARAMS((COORD4 *from, COORD4 *at, COORD4 *up,
  62.                   double fov_angle, double aspect_ratio,
  63.                   double hither, int resx, int resy));
  64. void lib_output_light PARAMS((COORD4 *center_pt));
  65. void lib_output_background_color PARAMS((COORD4 *color));
  66. char *lib_output_color PARAMS((COORD4 *color, double ka, double kd, double ks,
  67.                        double shine, double ang,
  68.                    double t, double i_of_r));
  69. void lib_output_cylcone PARAMS((COORD4 *base_pt, COORD4 *apex_pt,
  70.                 int curve_format));
  71. void lib_output_sphere PARAMS((COORD4 *center_pt, int curve_format));
  72. void lib_output_torus PARAMS((COORD4 *center, COORD4 *normal,
  73.                   double iradius, double oradius,
  74.                   int curve_format));
  75. void lib_output_box PARAMS((COORD4 *point1, COORD4 *point2));
  76. void lib_output_polygon PARAMS((int tot_vert, COORD4 *vert));
  77. void lib_output_polypatch PARAMS((int tot_vert, COORD4 *vert, COORD4 *norm));
  78. void lib_output_sq_sphere PARAMS((COORD4 *center_pt, double a1, double a2,
  79.                   double a3, double n, double e));
  80.