Jump to content
  • Advertisement
Sign in to follow this  
meteorstorm42

OpenGL Need help with OpenGL clip plane equation...

This topic is 3074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use glClipPlane( GL_CLIP_PLANE0, clipPlaneEquation ) to create a clip plane that cuts off anything above y = -0.95 (to cut off reflected geometry)

But I can't find enough info on this clip plane equation... just that it's a vector of 4 doubles.

I guessed that the first 3 were the normal, and the last was a translation along the normal, but neither [0, -1, 0, 0.95] nor [0, -1, 0, -0.95] worked.
Erm.... help?

Share this post


Link to post
Share on other sites
Advertisement
The first three parameters define the normal of the plane. I usually leave the fourth parameter as 0.

Try these two exercises to see if it makes a difference:

Exercise 1:
- Set the clip plane equation to <0, 1, 0, 0>. Enable the clip plane.
- Draw a sphere using gluSphere or gluSolidSphere, radius = 1.

Exercise 2:
- glPushMatrix();
- glTranslate(0, 0.5, 0)
- Set the clip plane equation to <0, 1, 0, 0>. Enable the clip plane.
- glPopMatrix();
- Draw a sphere using gluSphere or gluSolidSphere, radius = 1.

If I'm not mistaken, the first exercise should clip off the top half of the sphere, and the second exercise should clip off the top 1/4th of the sphere.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!