Camera bug
pavelvasev opened this issue · comments
Hi Felix!
First of all, thank you very much for your great project! What about the issue, I tried to fix it by myself with PR in mind, but failed to do that. So I just report it to you.
Describe the bug
If to follow example of call to configureControls
presented at
https://github.com/felixpalmer/procedural-gl-js/blob/main/src/export/controls.js#L37
we see option value maxPolarAngle: 0.8 * Math.PI
.
That's great idea because it allows us for example to look on mountains from below to top.
However, on more-less flat surfaces the camera easily goes below ground level when this maxPolarAngle
value is used.
And then, the view sometimes becomes corrupted, with no way to return above ground level.
To Reproduce
Steps to reproduce the behavior:
- Use configureControls function with
maxPolarAngle: 0.8 * Math.PI
option. - Move camera under ground (below ground level) using rotation.
- Pan it a little bit (staying below ground).
- See no way back for camera to the above ground level ;-)