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 3 of 3

Thread: User defined clip planes: Transform by modelview matrix...

  1. #1
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Austin, TX, USA
    Posts
    150

    User defined clip planes: Transform by modelview matrix...

    All,

    What is the best method for forcing a UCP to be transformed by the modelview matrix? I'm not so much concerned about performance, more about doing it The Right Way.

    At this point, I suppose for every frame I could:
    glGet the modelview matrix
    multiply by the UCP definition
    redeclare the UCP with new definition
    enable UCP
    drawObject
    disable UCP

    But, this seems very expensive for the end effect. Is there some magical shortcut I can enable which forces UCP's to be transformed by the modelview matrix?

    Regards,

    Glossifah

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: User defined clip planes: Transform by modelview matrix...

    Depends on the effect you want to achieve.
    Should the clip plane stay fixed in the view while the object is transformed or should it move with the object?

    Here is the text from MS help on glClipPlane:
    "When you call glClipPlane, equation is transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have no effect on the stored plane-equation components. "

    I read this as: If you want to rotate the clip plane with the object you'll have to call glClipPlane for each modelview change, otherwise only once at startup/definition of the plane.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Austin, TX, USA
    Posts
    150

    Re: User defined clip planes: Transform by modelview matrix...

    Fantastic!

    That works. Calling glClipPlane() after doing whatever transforms causes those transforms to be applied. I had hoped that just enabling it would, but I suppose this method is the most flexible.

    Thanks Relic.

    Glossifah

Posting Permissions

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