home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / 3DTOSHI2.ZIP / mpg3d / include / G3dmath.h < prev    next >
C/C++ Source or Header  |  1996-04-28  |  2KB  |  71 lines

  1.  
  2. // g3dmath.h
  3. //
  4. // Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.
  5.  
  6. #ifndef __G3DMATH_H__
  7. #define __G3DMATH_H__
  8.  
  9. #include "stdgfx.h"
  10. #include "g3ddef.h"
  11.  
  12. struct FLPVECTOR3D 
  13.   {
  14.     float x,y,z,w;
  15.   }; // End of FLPVECTOR3D
  16.   
  17. struct FXPVECTOR3D 
  18.   {
  19.     LONG x,y,z,w;
  20.   }; // End of FXPVECTOR3D
  21.   
  22. struct FLPVECTOR2D 
  23.   {
  24.     float x,y;
  25.   }; // End of FLPVECTOR3D
  26.   
  27. struct FXPVECTOR2D 
  28.   {
  29.     LONG x,y;
  30.   }; // End of FXPVECTOR3D
  31.   
  32. struct FLPPOINT2D
  33.   {
  34.     float x,y;
  35.     float u,v;
  36.     float I;
  37.     float Haze;
  38.     float z;
  39.     float Reserved1; 
  40.   }; // End of FLPPOINT2D
  41.   
  42. struct FXPPOINT2D
  43.   {
  44.     LONG x,y;
  45.     LONG u,v;
  46.     LONG I;
  47.     LONG Haze;
  48.     LONG z;
  49.     LONG Reserved1; 
  50.   }; // End of FXPPOINT2D
  51.   
  52. VOID InitMatrix ( G3DMATRIX Matrix );
  53. VOID CopyMatrix ( G3DMATRIX Src, G3DMATRIX Dest );
  54. VOID MultMatrix ( G3DMATRIX Mat1, G3DMATRIX Mat2, G3DMATRIX Dest );
  55. VOID Translate ( G3DMATRIX Matrix, float xt, float yt, float zt );
  56. VOID Scale ( G3DMATRIX Matrix, float ScaleFactor );
  57. VOID RotateXYZ ( G3DMATRIX Matrix, float xa, float ya, float za );
  58. VOID RotateYXZ ( G3DMATRIX Matrix, float xa, float ya, float za );
  59.  
  60. float FLPVectorDot ( FLPVECTOR3D *V1, FLPVECTOR3D *V2 );
  61. float FLPVectorDistance ( FLPVECTOR3D *P1, FLPVECTOR3D *P2 );
  62. float FLPVectorMagnitude ( FLPVECTOR3D *V1 );
  63. VOID FLPVectorAdd ( FLPVECTOR3D *V1, FLPVECTOR3D *V2, FLPVECTOR3D *Result ); 
  64. VOID FLPVectorSub ( FLPVECTOR3D *V1, FLPVECTOR3D *V2, FLPVECTOR3D *Result ); 
  65. VOID FLPVectorNormalize ( FLPVECTOR3D *V1 );
  66. VOID FLPVectorCross ( FLPVECTOR3D *V1, FLPVECTOR3D *V2, FLPVECTOR3D *Result );
  67.  
  68. #endif
  69.  
  70.  
  71.