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: OpenGL matrix primer?

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    18

    OpenGL matrix primer?

    I'm pretty handy with matrix math, and I'm trying to create a hardware accelerated... thingy, called an Iterated Function System. Basically you take a square and copy it and transform it, and repeat that over and over again.

    The thing I'm having trouble with is figuring out how to transform everything right, and how to handle OpenGL matrices. The transformation consists of skew, scale, translation, and rotation in two dimensions... but I'm not really sure how to create the matrices (skew matrix especially - I know what's inside of it, just not how to get it into an OpenGL matrix).

    So...is there a good tutorial anywhere that explains all the ways to handle OpenGL matrices?

    To clarify: If you asked me to I could write the contents of the matrix out by hand. I'm alright with linear transformations... though while programming I get confused where the matrix is being applied.

    [edit]
    and the final result I would like would be a 2d affine transformation on a square centered at the origin. 4th row and 4th column would just be [0, 0, 0, 1]

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: OpenGL matrix primer?

    The OpenGL Programming Guide has a good description, IIRC. Here is another:

    http://www.songho.ca/opengl/gl_transform.html

Posting Permissions

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