We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
There is incorrect main diagonal in rotate matrix. You matrix
float r = toRadians(angle); float c = cos(r); float s = sin(r); float omc = 1.0f - c; float x = axis.x; float y = axis.y; float z = axis.z; result.elements[0 + 0 * 4] = x * omc + c; result.elements[1 + 0 * 4] = y * x * omc + z * s; result.elements[2 + 0 * 4] = x * z * omc - y * s; result.elements[0 + 1 * 4] = x * y * omc - z * s; result.elements[1 + 1 * 4] = y * omc + c; result.elements[2 + 1 * 4] = y * z * omc + x * s; result.elements[0 + 2 * 4] = x * z * omc + y * s; result.elements[1 + 2 * 4] = y * z * omc - x * s; result.elements[2 + 2 * 4] = z * omc + c;
And could be implemented as marix (see below)
So in main diagonal you should multiply (1 - cos a) on sqaure of the coordinate of the vector.. See below pic.
Probably fix it (w/o optimization and etc.)
result.elements[0 + 0 * 4] = x * x * omc + c; // fixed result.elements[1 + 0 * 4] = y * x * omc + z * s; result.elements[2 + 0 * 4] = x * z * omc - y * s; result.elements[0 + 1 * 4] = x * y * omc - z * s; result.elements[1 + 1 * 4] = y * y * omc + c; // fixed result.elements[2 + 1 * 4] = y * z * omc + x * s; result.elements[0 + 2 * 4] = x * z * omc + y * s; result.elements[1 + 2 * 4] = y * z * omc - x * s; result.elements[2 + 2 * 4] = z * z * omc + c; // fixed
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
There is incorrect main diagonal in rotate matrix. You matrix
And could be implemented as marix (see below)
So in main diagonal you should multiply (1 - cos a) on sqaure of the coordinate of the vector.. See below pic.
Probably fix it (w/o optimization and etc.)
The text was updated successfully, but these errors were encountered: