1 //------------------------------------------------------------------------------
2 // File : mat44test.cpp
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 // mat44test -- test compilation of all the functions in mat44 library
20 //----------------------------------------------------------------------------
22 //----------------------------------------------------------------------------
27 int main(int argc, char *argv[])
29 cout << "This is not a comprehensive correctness test. " << endl
30 << "It merely tests whether all the functions in mat44 will compile." <<endl;
34 Vec3f v(1.0, 1.0, 1.0);
35 Vec3f up(0.0, 1.0, 0.0);
39 m.Translate(1.0, 1.0, 1.0);
42 m.Scale(1.0, 1.0, 1.0);
44 m.invScale(1.0, 1.0, 1.0);
48 m.Frustum(-1.0, 1.0, -1.0, 1.0, 0.01, 20);
49 m.invFrustum(-1.0, 1.0, -1.0, 1.0, 0.01, 20);
50 m.Perspective(60, 1.4, 0.01, 20);
51 m.invPerspective(60, 1.4, 0.01, 20);
53 m.invViewport(200, 200);
54 m.LookAt(Vec3f::ZERO, v, up);
55 m.invLookAt(Vec3f::ZERO, v, up);
56 m.Viewport2(200, 200);
57 m.invViewport2(200, 200);
61 // These two should be transpose of one another
64 cout << "Ok there is this one test to make sure Transpose() is correct.\n"
65 "The above two matricies should be the transpose of one another.\n" << endl;