Skip to content
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

Transforming a plane with a matrix doesn't produce correct normal #9109

Closed
baothientran opened this issue Aug 24, 2020 · 2 comments · Fixed by #9135
Closed

Transforming a plane with a matrix doesn't produce correct normal #9109

baothientran opened this issue Aug 24, 2020 · 2 comments · Fixed by #9135

Comments

@baothientran
Copy link
Contributor

baothientran commented Aug 24, 2020

When transforming a plane with a matrix, the plane's normal is currently multiplied with the transform matrix itself. However, the transform matrix should be converted to normal matrix before multiplying with normal. This is the sandcastle's example(Notice the angle printed out on the console)

This also happens in the czm_transformPlane() glsl function

Another explanation from stack overflow:
https://stackoverflow.com/questions/7685495/transforming-a-3d-plane-using-a-4x4-matrix

@OmarShehata
Copy link
Contributor

Is this related to #8268 at all?

@baothientran
Copy link
Contributor Author

I think it is related as well since in the createPrimitiveModel() function, the normal is directly multiplied with the transform matrix instead of the normal matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants