## #2 matrixRotate logic is transposed

open
nobody
None
5
2014-08-28
2005-04-19
Anonymous
No

The column and row subscripts are reversed. Here's a
patch:

--- Matrix4.cpp~ 2005-04-03 13:24:16.610600000 -0700
+++ Matrix4.cpp 2005-04-18 12:44:36.559710400 -0700
@@ -323,16 +323,28 @@
double y = ax[1];
double z = ax[2];

+// rotate.set(0,0,txx+c);
+// rotate.set(1,0,tyx+sz);
+// rotate.set(2,0,t
zx-sy);
+
+// rotate.set(0,1,txy-sz);
+// rotate.set(1,1,t
yy+c);
+// rotate.set(2,1,t
zy+sx);
+
+// rotate.set(0,2,txz+sy);
+// rotate.set(1,2,t
yz-sx);
+// rotate.set(2,2,tzz+c);
+
rotate.set(0,0,txx+c);
- rotate.set(1,0,tyx+sz);
- rotate.set(2,0,t
zx-sy);
+ rotate.set(0,1,tyx+sz);
+ rotate.set(0,2,t
zx-sy);

• rotate.set(0,1,txy-s*z);
• rotate.set(1,0,txy-sz);
rotate.set(1,1,t
y*y+c);
• rotate.set(2,1,tzy+s*x);
• rotate.set(1,2,tzy+s*x);

• rotate.set(0,2,txz+s*y);

• rotate.set(1,2,tyz-s*x);
• rotate.set(2,0,txz+s*y);
• rotate.set(2,1,tyz-sx);
rotate.set(2,2,t
z*z+c);

return rotate;

nemccurd at cs dot ucsd dot edu

Anonymous