MATRICES.H 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /****************************************************************************
  2. * matrices.h
  3. *
  4. * This module contains all defines, typedefs, and prototypes for MATRICES.C.
  5. *
  6. * from Persistence of Vision(tm) Ray Tracer
  7. * Copyright 1996,1999 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. * NOTICE: This source code file is provided so that users may experiment
  10. * with enhancements to POV-Ray and to port the software to platforms other
  11. * than those supported by the POV-Ray Team. There are strict rules under
  12. * which you are permitted to use this file. The rules are in the file
  13. * named POVLEGAL.DOC which should be distributed with this file.
  14. * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. * Team Coordinator by email to team-coord@povray.org or visit us on the web at
  16. * http://www.povray.org. The latest version of POV-Ray may be found at this site.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23. #ifndef MATRICES_H
  24. #define MATRICES_H
  25. /*****************************************************************************
  26. * Global preprocessor defines
  27. ******************************************************************************/
  28. /*****************************************************************************
  29. * Global typedefs
  30. ******************************************************************************/
  31. /*****************************************************************************
  32. * Global variables
  33. ******************************************************************************/
  34. /*****************************************************************************
  35. * Global functions
  36. ******************************************************************************/
  37. void MZero (MATRIX result);
  38. void MIdentity (MATRIX result);
  39. void MTimes (MATRIX result, MATRIX matrix1, MATRIX matrix2);
  40. void MAdd (MATRIX result, MATRIX matrix1, MATRIX matrix2);
  41. void MSub (MATRIX result, MATRIX matrix1, MATRIX matrix2);
  42. void MScale (MATRIX result, MATRIX matrix1, DBL amount);
  43. void MTranspose (MATRIX result, MATRIX matrix1);
  44. void MTransPoint (VECTOR result, VECTOR vector, TRANSFORM *trans);
  45. void MInvTransPoint (VECTOR result, VECTOR vector, TRANSFORM *trans);
  46. void MTransDirection (VECTOR result, VECTOR vector, TRANSFORM *trans);
  47. void MInvTransDirection (VECTOR result, VECTOR vector, TRANSFORM *trans);
  48. void MTransNormal (VECTOR result, VECTOR vector, TRANSFORM *trans);
  49. void MInvTransNormal (VECTOR result, VECTOR vector, TRANSFORM *trans);
  50. void Compute_Matrix_Transform (TRANSFORM *result, MATRIX matrix);
  51. void Compute_Scaling_Transform (TRANSFORM *result, VECTOR vector);
  52. void Compute_Inversion_Transform (TRANSFORM *result);
  53. void Compute_Translation_Transform (TRANSFORM *transform, VECTOR vector);
  54. void Compute_Rotation_Transform (TRANSFORM *transform, VECTOR vector);
  55. void Compute_Look_At_Transform (TRANSFORM *transform, VECTOR Look_At, VECTOR Up, VECTOR Right);
  56. void Compose_Transforms (TRANSFORM *Original_Transform, TRANSFORM *New_Transform);
  57. void Compute_Axis_Rotation_Transform (TRANSFORM *transform, VECTOR V1, DBL angle);
  58. void Compute_Coordinate_Transform (TRANSFORM *trans, VECTOR origin, VECTOR up, DBL r, DBL len);
  59. TRANSFORM *Create_Transform (void);
  60. TRANSFORM *Copy_Transform (TRANSFORM *Old);
  61. UV_VECT *Create_UV_Vect (void);
  62. VECTOR *Create_Vector (void);
  63. VECTOR_4D *Create_Vector_4D (void);
  64. DBL *Create_Float (void);
  65. void MInvers (MATRIX r, MATRIX m);
  66. #endif