home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Graphics / SPD / Sources / libvec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-27  |  1.8 KB  |  56 lines  |  [TEXT/R*ch]

  1. /*
  2.  * libvec.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.  * Modified: 2 August 1993  - More ANSI C compatibility fixes (LIBVEC_H)
  11.  *           Eduard [esp] Schwan
  12.  *
  13.  */
  14. #ifndef LIBVEC_H
  15. #define LIBVEC_H
  16.  
  17. #include "def.h"
  18.  
  19. #if __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. #define X_AXIS  0
  24. #define Y_AXIS  1
  25. #define Z_AXIS  2
  26.  
  27. /* Basic math functions */
  28. void lib_zero_matrix PARAMS((MATRIX mx));
  29. void lib_create_identity_matrix PARAMS((MATRIX mx));
  30. void lib_copy_matrix PARAMS((MATRIX mres, MATRIX mx));
  31. void lib_create_translate_matrix PARAMS((MATRIX mx, COORD3 vec));
  32. void lib_create_scale_matrix PARAMS((MATRIX mx, COORD3 vec));
  33. void lib_create_rotate_matrix PARAMS((MATRIX mx, int axis, double angle));
  34. void lib_create_axis_rotate_matrix PARAMS((MATRIX mx, COORD3 rvec,
  35.                            double angle));
  36. void lib_create_canonical_matrix PARAMS((MATRIX trans, MATRIX itrans,
  37.                          COORD3 origin, COORD3 up));
  38. void lib_create_view_matrix PARAMS((MATRIX T, COORD3 from, COORD3 at,
  39.                     COORD3 up, int xres, int yres,
  40.                     double angle, double aspect));
  41. void lib_transform_coord PARAMS((COORD4 vres, COORD4 vec, MATRIX mx));
  42. void lib_transform_point PARAMS((COORD3 vres, COORD3 vec, MATRIX mx));
  43. void lib_transform_vector PARAMS((COORD3 vres, COORD3 vec, MATRIX mx));
  44. void lib_transpose_matrix PARAMS((MATRIX mxres, MATRIX mx));
  45. void lib_matrix_multiply PARAMS((MATRIX mxres, MATRIX mx1, MATRIX mx2));
  46. void lib_rotate_cube_face PARAMS((COORD3 vec, int major_axis, int mod_face));
  47. int lib_clip_to_box PARAMS((COORD3 start, COORD3 end,  double bounds[2][3]));
  48. double lib_normalize_vector PARAMS((COORD3 cvec));
  49. double lib_gauss_rand PARAMS((long iseed));
  50.  
  51. #if __cplusplus
  52. }
  53. #endif
  54.  
  55. #endif /* LIBVEC_H */
  56.