Search Projects

Wednesday, April 27, 2016

OpenGL Clipping Plane Example

In this blog post we are going to learn about the usage of clipping planes in OpenGL.  This opengl clipping plane example will help you understand the basics of planes along with the axes. The program we are going to show is interactive as well as educative. It will helps you out where you will be able to formulate plane in space as well as able to create a clipping plane in OpenGL.

You might know many algorithm including the cohen sutherland line clipping algorithm, which is in the program list for Lab in VTU 6th Sem CSE CGV. The plane clipping algorithm is similar to that. You can Download the opengl clipping plane example source code and easily understand the program what it trying to do, easy to manipulate the algorithm.

Following is interactive function in the program (also printed in the program itself)-

1' - toggle x=0 halfplane
2' - toggle y=0 halfplane
3' - toggle z=0 halfplane
j', 'l' - translate x=0 halfplane (when toggled)
',', 'i' - translate y=0 halfplane (when toggled)
u', 'm' - translate z=0 halfplane (when toggled)
x', 'y', 'z' - reverse the corresponding half plane
-', '=' - rotate about y-axis
(Left/Right) mouse buttons - rotate about y-axis
[', ']' - rotate viewpoint about x-axis
f' - toggle fill/wireframe drawmode

Download the Full Source Code

No comments:

Post a Comment