how to create and use a mat2 mat3 mat4 in codebox

    Jul 04 2016 | 11:19 am
    Hi everyone,
    Making steady progress with converting shadertoy examples into with codebox. So heres the next thing I'm stuck on. How to create the equivalent of a mat2, mat3, mat4 in codebox ?
    The book of shaders has the following explanation: link -
    -------------------------------------------------- Mat3
    3x3 floating point matrix
    Declaration mat3 aMat3 = mat3(1.0, 0.0, 0.0, // 1. column 0.0, 1.0, 0.0, // 2. column 0.0, 0.0, 1.0); // 3. column mat3 bMat3 = mat3(1.0);
    mat3 cMat3 = mat3(aVec3, bVec3, cVec3); mat3 dMat3 = mat3(aVec4, aVec3, bVec4, aFloat);
    How would I go about implementing this in codebox ? I'd like to keep everything on the GPU so I don't want to be creating small jit.matrix objects to send into the object. Any pointers ? Thanks !

    • Jul 05 2016 | 9:12 am
      Okay, so I got it working with a 2d rotation, The patch is below. Do's anyone know any good references which can give clear code based examples for mat3 and mat4, I also see that a mat3 can be converted to a vec2 and so on.
    • Jul 08 2016 | 10:18 am
    • Jul 08 2016 | 5:07 pm
      which example are you trying to convert?
      you should be able to perform mat3 math simply using 3 vec3's as storing each row of the matrix.