Login and open two windows, one for editing and one for compiling
and executing programs.
Copy the program clip.cpp from the lecture notes. Compile and execute it.
What is the use of the statement glTranslatef (0.0, 0.0, -5.0);
in dispaly() function? Comment this out and recompile your
program. What do you see when you run it? Why?
Now add the statement
gluLookAt ( 0, 0, 5, 0, 0, 0, 0, 1, 0 );
after gluPerspective() at reshape() function. What
do you see? What is the effect of gluLookAt() here?
Comment out
glEnable( CL_CLIP_PLANEi );.
What do
you see?
Now, restore your program and try changing the coefficients that
describe the clipping planes.
Try calling a modeling transformation, such as glRotate*(),
to affect glClipPlane(). Make the clipping plane
move independently of the objects in the scene.
Extra Credits
( EC 0.2 )
Draw a solid sphere with radius 1.0 at the center of the screen
( you may use glutSolidSphere() ). Clip the sphere
with the plane at x = 0.5.
(EC 0.1 )
Rotate your clipping plane around the y-axis.