1 //------------------------------------------------------------------------------
3 //------------------------------------------------------------------------------
4 // GLVU : Copyright 1997 - 2002
5 // The University of North Carolina at Chapel Hill
6 //------------------------------------------------------------------------------
7 // Permission to use, copy, modify, distribute and sell this software and its
8 // documentation for any purpose is hereby granted without fee, provided that
9 // the above copyright notice appear in all copies and that both that copyright
10 // notice and this permission notice appear in supporting documentation.
11 // Binaries may be compiled with this software without any royalties or
14 // The University of North Carolina at Chapel Hill makes no representations
15 // about the suitability of this software for any purpose. It is provided
16 // "as is" without express or implied warranty.
18 //============================================================================
19 // mat16fv.hpp : opengl-style float[16] matrix routines.
20 //----------------------------------------------------------------------------
22 //============================================================================
24 float* Copy16fv(float* A, const float* B); // A=B
26 float* Mult16fv(float* C, const float* A, const float* B); // C=A*B
29 float *NewV, const float* M, const float *V); // NewV = M * [Vx,Vy,Vz,0]
31 float* Mult16fv3fvPerspDiv(
32 float *NewV, const float* M, const float *V); // NewV = M * [Vx,Vy,Vz,1]
35 float *NewV, const float* M, const float *V); // NewV = M * [Vx,Vy,Vz,Vw]
37 float* Identity16fv(float* M);
38 float* Transpose16fv(float* M);
40 float* Rotate16fv(float *M, float DegAng, const float Axis[3]);
41 float* invRotate16fv(float *M, float DegAng, const float Axis[3]);
43 float* Scale16fv(float* M, float sx, float sy, float sz);
44 float* invScale16fv(float* M, float sx, float sy, float sz);
46 float* Translate16fv(float* M, float tx, float ty, float tz);
47 float* invTranslate16fv(float* M, float tx, float ty, float tz);
52 const float LookAtPt[3],
53 const float ViewUp[3]);
58 const float LookAtPt[3],
59 const float ViewUp[3]);
62 float* M, float l, float r, float b, float t, float n, float f);
64 float* invFrustum16fv(
65 float* M, float l, float r, float b, float t, float n, float f);
68 float* M, float Yfov, float Aspect, float Ndist, float Fdist);
70 float* invPerspective(
71 float* M, float Yfov, float Aspect, float Ndist, float Fdist);
75 const float X[3], const float Y[3], const float Z[3],
78 float* invViewing16fv(
80 const float X[3], const float Y[3], const float Z[3],
83 void Viewing2CoordFrame16fv(
84 const float *M, float X[3], float Y[3], float Z[3], float O[3]);
87 float* Viewport16fv(float* M, int WW, int WH);
89 float* invViewport16fv(float* M, int WW, int WH);
91 float* PlanarReflection16fv(float M[16], const float P[4]);
93 float XformCoordFrame16fv(
94 const float *M, float X[3], float Y[3], float Z[3], float O[3]);
96 float* Obj2WorldXform16fv(
97 float *M, float X[3], float Y[3], float Z[3], float O[3], float Scale);
99 float* World2ObjXform16fv(
107 float* Screen2WorldXform16fv(
109 const float X[3], const float Y[3], const float Z[3], const float O[3],
110 float l, float r, float b, float t, float n, float f,
113 float* World2ScreenXform16fv(
115 const float X[3], const float Y[3], const float Z[3], const float O[3],
116 float l, float r, float b, float t, float n, float f,
119 void Print16fv(const float* M);