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: Fatal bug in GLM getting started code example

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2008
    Posts
    6

    Fatal bug in GLM getting started code example

    I used the bit of code from the getting started page just to see if it compiled ok, and it actually triggered an assertion. It looks like the code on the getting started page has a bug:
    http://glm.g-truc.net/api-0.9.2/a00001.html

    The pdf manual has the same example but with the correct index to Model [] operator, 3 instead of 4.

    This is the code from the getting started page:

    glm::vec4 Position = glm::vec4(glm::vec3(0.0), 1.0);
    glm::mat4 Model = glm::mat4(1.0);
    Model[4] = glm::vec4(1.0, 1.0, 0.0, 1.0);
    glm::vec4 Transformed = Model * Position;

    A nice way to confuse newcomers

  2. #2
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: Fatal bug in GLM getting started code example

    Duplicating the manual in the API was maybe not such a great idea...

Posting Permissions

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