00001 #ifndef CAMERA_ 00002 #define CAMERA_ 00003 00004 #include <stdio.h> 00005 #include <windows.h> 00006 #include <GL/gl.h> 00007 #include <GL/glu.h> 00008 #include <GL/glut.h> 00009 00010 #include "PositionPath.h" 00011 #include "Geometry.h" 00012 00013 #define CAMERA_STANDARD_ANGLE 45.0 00014 #define CAMERA_STANDARD_RATIO 1.33333 00015 #define CAMERA_STANDARD_NEAR 0.1 00016 #define CAMERA_STANDARD_FAR 10000.0 00017 00018 #define DEG2RAD(a) (a * 0.01745329251994) 00019 #define RAD2DEG(a) (a * 57.2957795130823) 00020 00035 class Camera 00036 { 00037 public: 00042 Camera (); 00043 00047 ~Camera (); 00048 00057 void SetAttributes (double angle, double aspect_ratio, double near_cutoff, double far_cutoff); 00058 00062 void ApplyAttributes (); 00063 00069 void ApplyPosition (int time); 00070 00076 void ComputeInverseView (int time); 00077 00084 float * GetInverseView (); 00085 00089 PositionPath * position; 00090 00097 void BuildPlanes (int time); 00098 00104 void BuildPlanes2 (); 00105 00107 Plane left, right, top, bottom, front, back; 00108 00110 Plane planes[6]; 00111 00112 00117 void DrawFrustum (); 00118 00127 void DrawFrustum2 (int time); 00128 00134 void MoveForward (double amount); 00135 00141 void MoveRight (double amount); 00142 00148 void MoveUp (double amount); 00149 00150 private: 00151 /* members to store the attributes of the camera */ 00152 00154 double angle; 00155 00157 double aspect_ratio; 00158 00160 double near_cutoff; 00161 00163 double far_cutoff; 00164 00166 float inverse_view[16]; 00167 }; 00168 00169 00170 #endif