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

Thread: Matrix Multiplication

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2007
    Posts
    11

    Matrix Multiplication

    Hi People,

    I'm having some trouble trying to understand how to manage working with projection matrix, specifically with orthographic one.

    For example, using one the X axis, I set my left coord to -11 and my right coord to -1. In this case, I will have -(l + r)/2 => -(-11 - 1) / 2 => 12/6 => 6.
    How is it possible if I've defined a volume of 10? Is there a rule that the right coord must be positive?

    Thanks!

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Matrix Multiplication

    http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml

    Here you see that X and Y's signs are kept, Z's sign is flipped.

    X is positive to the right of the screen, Y is bottom-up.
    You can define whatever direction you want.
    The proj. matrix simply transforms vertex coordinates to clipspace. With the glOrtho you define which region (a cuboid) of view-space will be contained in clipspace, and whether to flip each of the 3 axes. No rules, so don't wonder and go with whatever values are comfortable for your project. I.e some 2D games flip Y, and make the top-left match [0;0], for the convenience in staying with the convention they've been using for years.

Posting Permissions

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