Results 1 to 3 of 3

Thread: using viewport to generate clip planes

  1. #1
    Member Contributor
    Join Date
    Sep 2002
    Location
    Edmonton Canada
    Posts
    76

    using viewport to generate clip planes

    Hi,

    So I think there must be an easier way to do this.....

    I am trying to make an effect where I can clip out a portion of the window. As I understand, the plane equation in glClipPlane has to be in object coordinates, and then the clipper takes care of putting it in eye coordinates. This is fine, but if I want to use say a plane that cuts the scene 1/4 the way from the top, how do I get this in object coordinates?

    The way I thought would work, would be to find the values of the points in eye coordinates that make up the near plane. Then find some new points 1/4 the way down from the top. But then I would have to transform them to object coordinates (not sure how this is done) for the clipper to then transform them back to eye coordinates? Does this seem right? Isnt it a redundant transformation? (that is why I am wondering if there is a better way).

    So..basically, I am looking for a way to get a clip plane in object coordinates from a plane in window coordinates...


    Another kind of related question, is : how can you determine how far an object would have to move before it would move out of the view.


    [This message has been edited by bumby (edited 07-10-2003).]

    [This message has been edited by bumby (edited 07-10-2003).]

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: using viewport to generate clip planes

    Originally posted by bumby:
    So..basically, I am looking for a way to get a clip plane in object coordinates from a plane in window coordinates...
    For viewport clipping, lookup Scissoring=glScissor

    Another kind of related question, is : how can you determine how far an object would have to move before it would move out of the view.
    From the projection and modelview matrices you can extract the planes that define the viewing frustum. Great tutorial including code here: http://www.markmorley.com/opengl/frustumculling.html

  3. #3
    Member Contributor
    Join Date
    Sep 2002
    Location
    Edmonton Canada
    Posts
    76

    Re: using viewport to generate clip planes

    Thanks,

    I think glScissor is what i was looking for...not glClipPlane...

Similar Threads

  1. max clip planes
    By Tanji in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 03-27-2011, 04:34 AM
  2. Standard clip planes
    By V-man in forum OpenGL: GLSL
    Replies: 11
    Last Post: 10-31-2006, 05:52 PM
  3. User clip planes...
    By ebray99 in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 08-21-2006, 10:02 PM
  4. Viewvolume Clip Planes
    By glfreak in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 11-25-2004, 12:25 AM
  5. Clip-Planes as Polygons
    By jeppa in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-30-2002, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean