Mixed order of elements in matrix
See original GitHub issueWhen initializing a matrix with all elements, the order of these elements corresponds to row-wise iteration, whereas actual indexing of the matrix elements is done column-wise. That is confusing, and may easily cause errors.
Example code:
var matrix1 = new THREE.Matrix4(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
for (var i = 0; i < matrix1.elements.length; i++) {
console.log("matrix1[" + i + "] = " + matrix1.elements[i]);
}
Example output:
matrix1[0] = 0
matrix1[1] = 4
matrix1[2] = 8
matrix1[3] = 12
matrix1[4] = 1
matrix1[5] = 5
matrix1[6] = 9
matrix1[7] = 13
matrix1[8] = 2
matrix1[9] = 6
matrix1[10] = 10
matrix1[11] = 14
matrix1[12] = 3
matrix1[13] = 7
matrix1[14] = 11
matrix1[15] = 15
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to mix order of rows in a matrix? - MATLAB Answers
Assuming that your matrix has the same number of rows as your vector has elements, then you just need to use the same...
Read more >Rearrange all elements of array which are multiples of x in ...
Given an array of integers 'arr' and a number x, the task is to sort all the elements which are multiples of x...
Read more >Finding the order of an element in GL(2,R)
My difficulty lies with problem 1b where I am given a matrix A= (0−110) and asked to find its order. Now I am...
Read more >Mixed array - APL Wiki
In nested array theory, a mixed array is one that mixes simple scalar characters and numbers, or simple scalars with arrays which are...
Read more >Mixed finite element method - Wikipedia
In numerical analysis, the mixed finite element method, is a type of finite element method in which extra fields to be solved are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would leave it the way it is, personally. The API is human-readable.
That’s historically grown.
In r1 the math library was row major completely but the graphics renderer was column major which meant we had to transpose the matrices every frame.
In r49 the math library got update to make use of Float32Array and column major to have no problems with the graphics renderer. To make sure the transition would be easy we kept every methods arguments the same because a lot of code was already working with it and not a lot of code needed to know the elements exact value.