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: webgl matrix set

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    127

    webgl matrix set

    hello.
    I would understand how i can assign a value to an index in a webgl matrix.
    I tryed with
    var mx = mat4.create();
    mx[0][0] = 0.31312312 or
    mx[1][0] = 0.2222222

    but don't work.
    thanks.

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2007
    Posts
    8

    Re: webgl matrix set

    It looks like you are using glMatrix. If that is the case, the matrices are stored as flat arrays (both for speed and compatibility with shader uniforms).

    As such, mx[0][0] is just mx[0], mx[1][0] is mx[4], etc.

Posting Permissions

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