Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to move clipping plane of OpenGL and begin the clipping from that position. The default location of clipping plane is (0,0,0), so if my model is far enough from the center of coordinate system it immediately disappears, as I begin the clipping, cause it appears in the half clipped by the plane that just moved from (0,0,0) point. So what I need is :

  1. Create a clipping plane
  2. Translate it to the point I want (normally it's near model surface I want to clip)
  3. Begin the clipping from that point and not from (0,0,0).

How can I achieve my goal ?

share|improve this question
So, did jpaver's suggestion work? – sam hocevar Nov 4 '11 at 22:03
up vote 2 down vote accepted

glClipPlane takes 4 coordinates for the plane equation: {Nx, Ny, Nz, d}, where N=[Nx,Ny,Nz] is the normal of the plane, and d is the projected distance of any point on that plane along the normal.

The definition of a plane is:

dotProduct(P,N) + d = 0

(where P is any point on that plane)

So, by simple math,

d = -dotProduct(P,N)

eg. if you want to place your plane at (0,3,1), you calculate:

d = -dotProduct([0,3,1], [Nx,Ny,Nz])

then it should just be a matter of sending Nx,Ny,Nz,d to glClipPlane.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.