00001
00002
00003
00004 #ifndef GL_UTILS_HPP
00005 #define GL_UTILS_HPP
00006 #include <GL/glut.h>
00007 #include <stdio.h>
00008
00009 void DisplayMinMaxBox(float Min[3], float Max[3],
00010 float r=1, float g=1, float b=1, float LineWidth=1);
00011
00012 void GLerror(char *msg);
00013
00014
00015
00016 inline float LinearizeZ(float DepthZ, float NearDist, float FarDist)
00017 {
00018 return (NearDist*FarDist) / ( FarDist - DepthZ*(FarDist-NearDist) );
00019 }
00020
00021
00022 inline float DepthifyZ(float LinearZ, float NearDist, float FarDist)
00023 {
00024 return ((FarDist*(LinearZ-NearDist))/ ( LinearZ*(FarDist-NearDist) ) );
00025 }
00026 #endif