You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For pi/2 it gives result of
[0 0 -1]
[0 1 0]
[1 0 0]
which is incorrect.
It should be
[0 0 1]
[0 1 0]
[-1 0 0]
Rows are written in place of columns (like transpose).
Code should be corrected as given below.
/// Turns the matrix into a rotation of [radians] around Y
void setRotationY(double radians) {
final c = math.cos(radians);
final s = math.sin(radians);
_m3storage[0] = c;
_m3storage[1] = 0.0;
_m3storage[2] = -s;
_m3storage[3] = 0.0;
_m3storage[4] = 1.0;
_m3storage[5] = 0.0;
_m3storage[6] = s;
_m3storage[7] = 0.0;
_m3storage[8] = c;
}
Please check.
The text was updated successfully, but these errors were encountered:
I just stumbled over this bug, too. As it is implemented, the rotation would be clockwise which does not fit the norm (right-hand-rule) and is inconsistent with setRotationX and setRotationZ.
For pi/2 it gives result of
[0 0 -1]
[0 1 0]
[1 0 0]
which is incorrect.
It should be
[0 0 1]
[0 1 0]
[-1 0 0]
Rows are written in place of columns (like transpose).
Code should be corrected as given below.
/// Turns the matrix into a rotation of [radians] around Y
void setRotationY(double radians) {
final c = math.cos(radians);
final s = math.sin(radians);
_m3storage[0] = c;
_m3storage[1] = 0.0;
_m3storage[2] = -s;
_m3storage[3] = 0.0;
_m3storage[4] = 1.0;
_m3storage[5] = 0.0;
_m3storage[6] = s;
_m3storage[7] = 0.0;
_m3storage[8] = c;
}
Please check.
The text was updated successfully, but these errors were encountered: