Smt. Kamala & Sri. Venkappa M.
Agadi
College of Engineering & Technology Lakshmeshwar – 582116
Department of Computer Science & Engineering
Subject: Computer Graphics & Visualization- Sub Code: 18CS62
Topic: OpenGL Visibility Detection Functions
Mr. Vikram Shirol
Associate Professor
Dept of CSE
[email protected] Website: http://www.agadiengcollege.com : http://facebook.com/sksvlxr
: https://twitter.com/SKSVMACET_LXR
OpenGL Visibility-Detection Functions
OpenGL Polygon-Culling Functions
• Back-face removal is accomplished with the functions
glEnable (GL_CULL_FACE);
glCullFace (mode);
• Where ‘mode’ => GL_BACK / GL_FRONT / GL_FRONT_AND_BACK
• The culling routine is turned off with
glDisable (GL_CULL_FACE);
OpenGL Depth-Buffer Functions
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB |
GLUT_DEPTH);
• Depth buffer values can then be initialized with
glClear (GL_DEPTH_BUFFER_BIT);
• The OpenGL depth-buffer visibility-detection routines are activated
with the following function:
glEnable (GL_DEPTH_TEST);
• And we deactivate the depth-buffer routines with
glDisable (GL_DEPTH_TEST);
OpenGL Wire-Frame Surface-Visibility Methods
• A wire-frame display of a standard graphics object can be obtained in
OpenGL by requesting that only its edges are to be generated.
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
• But this displays both visible and hidden edges.
OpenGL Depth-Cueing Function
• We can vary the brightness of an object as a function of its distance
from the viewing position with
glEnable (GL_FOG);
glFogi (GL_FOG_MODE, GL_ LINEAR);