Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Clipping plane

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Haifa, ISRAEL
    Posts
    101

    Clipping plane

    How can I see the clipped portion of an object and not the part that is toward the view point? How can I control what side of a clipping plane is seen and what part is not.
    Thanks

  2. #2
    Junior Member Regular Contributor
    Join Date
    Oct 2000
    Location
    Donetsk,Ukraine
    Posts
    120

    Re: Clipping plane

    Maybe you should disable culling.
    You can control part (half-space) by multiplying equation on -1.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    839

    Re: Clipping plane

    Hello,

    what randy said is true, but it isn't quite as ad hoc as trying a plane, realising its wrong, and then multiplying it by -1.

    a 3D plane is defined by the equation

    Ax + By + Cz + D = 0

    Any point in three space can be mapped to the LHS of the equation. If the answer is 0, then the point lies ON the plane; if the answer is >0, then the point lies on the positive semispace of the plane (and is retained by OpenGL); otherwise the point lies on the negative space of the plane (and is clipped).

    The magic important point about the plane equation is that its normal is given by <A, B, C>. So, for example, the plane

    0x + 0y -1z + 0
    = -z

    is the plane passing through the origin with normal pointing down the negative z axis. Ergo, any point with a negative z value will be retained, whereas any positive z will be clipped. My point is that this can all be worked out mathematically without guessing and then multiplying by -1 when it doesn't work.

    cheers,
    John

  4. #4
    Intern Newbie
    Join Date
    May 2001
    Location
    Hungary
    Posts
    36

    Re: Clipping plane

    You can control the face to cull with glCullFace(). Default is GL_BACK. If You change it to GL_FRONT the other side of the face will be culled.

    Hope that's you wanted

  5. #5
    Intern Newbie
    Join Date
    May 2001
    Location
    Hungary
    Posts
    36

    Re: Clipping plane

    Sorry... I didn't understand your question for first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •