RE: LDView 4.2 Released
2017-10-23, 4:46 (This post was last modified: 2017-10-23, 4:51 by Michael Horvath.)
2017-10-23, 4:46 (This post was last modified: 2017-10-23, 4:51 by Michael Horvath.)
(2017-10-23, 4:05)Travis Cobbs Wrote:(2017-10-22, 20:52)Michael Horvath Wrote: Also, I have written a matrix to euler converter in Lua for another project. Could someone explain how to convert it to C++?
The array of floats has indices that go from 0 to 15. I can't remember if it is horizontal first, or vertical first. If it is horizontal first, the mapping would be:
r00 = matrix[0];
r01 = matrix[1];
r02 = matrix[2];
r10 = matrix[4];
r11 = matrix[5];
r12 = matrix[6];
r20 = matrix[8];
r21 = matrix[9];
r22 = matrix[10];
(Note that the 4th column is skipped, because the rotation portion is a 3x3 matrix, but the data in LDView is a 4x4 matrix.)
If it vertical first, the mapping would be:
r00 = matrix[0];
r00 = matrix[4];
r02 = matrix[8];
r10 = matrix[1];
r11 = matrix[5];
r12 = matrix[9];
r20 = matrix[2];
r21 = matrix[6];
r22 = matrix[10];
Should the function that does this be a member of TCVector?
Also, could you rewrite the function? I am not familiar with C++ syntax.