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

Thread: Mirrors

  1. #1
    Guest

    Mirrors

    Hi,

    One simple question:
    How to make a mirror in room?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    Melbourne, Australia
    Posts
    224

    Re: Mirrors

    orthogonal mirror is very simple
    say you want mirror parallel to XY plane, that's one of general 2 solutions I know (without stencil buffer):

    1. draw everything with inversed Z coordinate, thus if your whole mirror has all Z coordinates = some_z you need to replace z coordinate of your objects with
    (-z + 2*some_z)
    2. clean z-buffer
    3. draw alpha-blended poly over the mirror
    4. draw everything

    hope it helps

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: Mirrors

    Go to http://nehe.gamedev.net/
    There is a very good tutorial about mirrors (Using the stencil buffer).

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  4. #4
    Intern Contributor
    Join Date
    Jul 2002
    Location
    Seri Kembangan, Selangor, Malaysia
    Posts
    92

    Re: Mirrors

    viewport also is a solution method

Posting Permissions

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