Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

glutils.hpp

00001 //============================================================================
00002 // glutils.cpp : OpenGL handy rendering utilities
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 // Convert depth buffer values into euclidean Z
00016 inline float LinearizeZ(float DepthZ, float NearDist, float FarDist)
00017 {
00018   return (NearDist*FarDist) / ( FarDist - DepthZ*(FarDist-NearDist) ); 
00019 }
00020 
00021 // Convert euclidean Z into depth buffer values
00022 inline float DepthifyZ(float LinearZ, float NearDist, float FarDist)
00023 {
00024   return ((FarDist*(LinearZ-NearDist))/ ( LinearZ*(FarDist-NearDist) ) ); 
00025 }
00026 #endif

Generated at Fri Oct 12 15:12:20 2001 for GLVU by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001