/**
 * Transpose and extract 3 rows from mat4x4
 * @param {number[]|Float32Array} destination
 * @param {number} destination_offset
 * @param {number[]|Float32Array} source
 * @param {number} source_offset
 */
export function mat4x4_transpose_copy_to_mat4x3(destination, destination_offset, source, source_offset) {
    // row 0
    destination[destination_offset] = source[source_offset];
    destination[destination_offset + 1] = source[source_offset + 4];
    destination[destination_offset + 2] = source[source_offset + 8];
    destination[destination_offset + 3] = source[source_offset + 12];

    // row 1
    destination[destination_offset + 4] = source[source_offset + 1];
    destination[destination_offset + 5] = source[source_offset + 5];
    destination[destination_offset + 6] = source[source_offset + 9];
    destination[destination_offset + 7] = source[source_offset + 13];

    // row 2
    destination[destination_offset + 8] = source[source_offset + 2];
    destination[destination_offset + 9] = source[source_offset + 6];
    destination[destination_offset + 10] = source[source_offset + 10];
    destination[destination_offset + 11] = source[source_offset + 14];
}