Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: how to specify a matrix vertex attribute

  1. #11
    Newbie Newbie
    Join Date
    Nov 2012
    Posts
    1
    Quote Originally Posted by Michele Bosi View Post

    glVertexAttribPointer(MyMatID+0, ....); // column 0
    glVertexAttribPointer(MyMatID+1, ....); // column 1
    glVertexAttribPointer(MyMatID+2, ....); // column 2
    glVertexAttribPointer(MyMatID+3, ....); // column 3
    Would you mind sharing how you're setting up your vertex attribute pointers? I'm attempting and this isn't working for me. For example, I'm using:

    glVertexAttribPointer(MyMatID+0, 4, GL_FLOAT, GL_FALSE, 0, NULL);
    glVertexAttribPointer(MyMatID+1, 4, GL_FLOAT, GL_FALSE, 0, NULL);
    glVertexAttribPointer(MyMatID+2, 4, GL_FLOAT, GL_FALSE, 0, NULL);
    glVertexAttribPointer(MyMatID+3, 4, GL_FLOAT, GL_FALSE, 0, NULL);

    but I'm not sure whether the stride and offset are correct.

    Also, do those 4 attribute locations represent the rows or the columns of the matrix?

  2. #12
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    Of course that it doesn't work. Do you know the meaning of the last two parameters? If you are referring to the same VBO, offsets cannot be 0 for all attributes, as well as stride.
    1. Look at the specification of the glVertexAttribPointer function.
    2. Never revive such old posts! This is almost 5 years old post, and there is no purpose asking OP anything now.

    Request for the administrator (web master): Is it possible to automatically lock threads after 6 months of inactivity?

  3. #13
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,183
    Agreed! Suggested that recently at the bottom of the OpenGL forum upgrade thread. Might follow up there or PM Khronos_webmaster to request this.

Posting Permissions

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