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

Orthographic frustum glitches when the camera's direction is parallel to the ground #9720

Open
ugnelis opened this issue Aug 11, 2021 · 2 comments

Comments

@ugnelis
Copy link

ugnelis commented Aug 11, 2021

Hi all,

I am experiencing a frustum bug when I use the orthographic frustum in the 3D Cesium mode. It happens when the camera’s direction is parallel or almost parallel to the ground. Sometimes the camera glitches when the angle between the camera’s direction and the ground is higher. Also, I noticed that scrolling doesn’t work well in the frustum mode. Even though I scroll the mouse only backward, it can be seen the sometimes camera moves forwards, and then back, and then forward again.

I have provided a sandcastle example, but to feel better the bug is useful to go around with mouse while having a low angle between camera and ground.

Sandcastle example:
https://sandcastle.cesium.com/#c=hVTLbtswEPwVwicZcKm3JSVO0CBt0QABEiRGe9GFllYWG4oUSEpGWvTfS4q2USdpc7K5OzO7O0tqJBKNFHYg0QXisEPXoOjQ4W9TzCtn1XS+FlwTykGWswX6VXKENEhpIvdSjLQGeXYgVhKIhu9CsnrtIN58YQm9FD+g0lTwe1o9WYaWA5jU7/l5yUvu+2g9SI5E0xzEccldb1hVwAFvmdgAVq3YmWYbwhScv0A0YouBkw2D+l8Q9fR8pTuh+hbkK7GpjeuW8C2gRg5Km4mO/Ip0IAlWO6qrdi3upG7FVpK+pdUXh/WOo9wKUiNNGSjQVsHYvD+d+ux+4k9rl/QmbwfJjn7eCP4ASgyyMtNJ0V0pA7upvXCZROH8YN/JhL2kHdV0BIVJXXv7uq6101GqadLawj6PwPUtVdooSK8Z+LQqb+62XQmuBAPMxNY7lWiB1JRvrfr/YL317D2QFIy9KyQUtZ1Z3P7mTIY/Gmf3kBd2HNYG2l5q53ANSlNOrNDZyTqI1OYf4bFnYQglSRBmYYzzKE7zKCmKhYtHURpmAc7zNEiiKDrGk7RIkzTBZjlxlCRRasPuAQhJjcWva351Dt5bhx6MA4fKOCuWRRwUWRCk2XKZ7Ct8CHAQxWG4DPMgyLM8Wwb5PrXEUR6HeZIXWZTGaVAcih+NKvlsMVsp/czg0nEQ+ki7Xkhtb52Hsa+h65l5wsrfDOadalwp5ZaC0Mr/m7qq6YhoffHGRwJVjChlMs3A2CP9CeXscuUb/CsqE9P0dyNIRp4trA0vb10QY7zyzfFtphaCbYh8ofwH

Browser:
Firefox
Chromium,

Operating System:
Linux Mint 20

@ugnelis
Copy link
Author

ugnelis commented Aug 18, 2021

This line https://github.com/CesiumGS/cesium/blob/main/Source/Scene/Camera.js#L1162 causes the problem as it sets very high frustum width, because of it the Orthographic frustum initially jumps too much. Also, I have noticed that when there is no behind the object (e.g., terrain, plane, etc.) and the mouse points not on the object, the frustum width is randomly being set to large (https://github.com/CesiumGS/cesium/blob/main/Source/Scene/Camera.js#L1154-L1160). One of the hacky solutions is to place an invisible plane behind the needed object that the depth distance could be triggered. Then the frustum width becomes pretty decent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment