New issue
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
Possible error when setting model matrix #1956
Comments
Can you share code showing the problem? |
The problem was detected at the new A.R. demo we are working on: https://github.com/sidia-dev-team/GearVRf-Demos/tree/feature_arpet More specifically in the method starting here: https://github.com/sidia-dev-team/GearVRf-Demos/blob/83a0821c57f57e9e53df07532f65dc67a3b77c25/gvr-arpet/app/src/main/java/org/gearvrf/arpet/PlaneHandler.java#L58 I replaced the call to I will make some changes to this demo so that you can easily visualize the problem. |
I just added some "visual debug" code to the demo. Just uncomment the lines starting here: It will make a box appear on the detected plane. Then you can switch to way this box transform is updated uncommenting the two lines starting here: and then commenting the lines starting here: |
I also created a simpler application to demonstrate the problem: |
It does look to be row-vector vs column-vector issue. Please check #1969. |
I tested your fix and it worked fine! |
Fix has been merged |
GearVRf/GVRf/Framework/framework/src/main/jni/objects/components/transform.cpp
Line 151 in 79c0f3e
I'm facing a problem when trying to set model matrix to a scene object and it seems the statement starting at the line above is the reason. When setting model matrix for a scene object (using
setModelMatrix(Matrix4f mat)
) position and scale are correct but rotation is not. I tried to calculate position, scale and rotation at Java side (using JOML) and then apply them (using Java transform API methods) and it worked fine. Then I tried to change the above statement as below and it also worked:glm::mat3 rotation_mat(matrix[0][0] / new_scale.x, matrix[0][1] / new_scale.x, matrix[0][2] / new_scale.x, matrix[1][0] / new_scale.y, matrix[1][1] / new_scale.y, matrix[1][2] / new_scale.y, matrix[2][0] / new_scale.z, matrix[2][1] / new_scale.z, matrix[2][2] / new_scale.z);
Is this really and issue or maybe there is something else to consider when setting model matrix?
The text was updated successfully, but these errors were encountered: