home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / togl15.zip / a1.zip / util.h < prev   
C/C++ Source or Header  |  2000-02-16  |  2KB  |  45 lines

  1. #ifndef _UTIL_
  2. #define _UTIL_
  3.  
  4. #include "gr.h"
  5.  
  6. /* points and vectors */
  7. extern GrVector3D    mkVector3D( double x, double y, double z );
  8. extern GrPoint3D    mkPoint3D( double x, double y, double z );
  9.  
  10. extern double        vvDot( GrVector3D v1, GrVector3D v2 );
  11. extern GrVector3D    svMpy( double s, GrVector3D v );
  12.  
  13. extern GrVector3D    vvAdd( GrVector3D v1, GrVector3D v2 );
  14. extern GrPoint3D    pvAdd( GrPoint3D v1, GrVector3D v2 );
  15.  
  16. extern GrVector3D    ppSub( GrPoint3D v1, GrPoint3D v2 );
  17. extern GrVector3D    vvSub( GrVector3D v1, GrVector3D v2 );
  18. extern GrPoint3D    pvSub( GrPoint3D v1, GrVector3D v2 );
  19.  
  20. extern double        vNormalize( GrVector3D *v );
  21.  
  22. extern GrVector3D    crossProd(GrVector3D u, GrVector3D v);
  23. extern GrVector3D    transVec(GrMatrix4x4 mat, GrVector3D v);
  24. extern GrPoint3D    transPoint(GrMatrix4x4 mat, GrPoint3D p);
  25. extern GrVector3D    transNorm(GrVector3D p, GrMatrix4x4 mat);
  26.  
  27. /* matrices */
  28. extern void        initMatrix(GrMatrix4x4 h);
  29. extern void        mulMatrix(GrMatrix4x4 ret, 
  30.                   GrMatrix4x4 mat1, GrMatrix4x4 mat2);
  31. extern void             TransposeMatrix(GrMatrix4x4 ret, GrMatrix4x4 inMatrix);
  32. extern void             Print_Matrix(GrMatrix4x4 A);
  33. extern void             Print_Node_Matrix(char *name);
  34. void                    CopyMatrix(GrMatrix4x4 From, GrMatrix4x4 To);
  35.  
  36. /* colours */
  37. extern GrColour        mkColour( double c);
  38. extern GrColour        cMult( GrColour c1, GrColour c2 );
  39. extern GrColour        cMultAdd( GrColour c1, GrColour c2, GrColour c3);
  40.  
  41. /* print */
  42. extern void             printPoint3D(GrPoint3D);
  43.  
  44. #endif /* _UTIL_ */
  45.