In my cinder application, the user can drag and zoom the camera out similar to Blender style. (and based on the CameraUI class).
However, I’ve got a bit of a problem with my camera in that the user is free to mouse wheel zoom way back until the numbers overflow and the application crashed with a cinder::PlaneExc exception, which I think is caused by some NaNs being used maybe due to overflow, but this is where I’m struggling to understand whats going on and how this problem is generally solved.
I declare in the main app:
then in my camera update I am doing:
... mCamera->mVisibleWorldFrustrum.set(mCamera->mCamera); ...
which, when zooming way out triggers:
I assume this problem is due to a particular set of conditions (v1 == v2?) such that normal = 0 which is problem for the maths here, but I’m not sure how to get around this. I’d be grateful if anyone could steer me in the right direction - I would like to limit the users camera limit such that I don’t get maths oddities and overflows, to limit the camera movement in a graceful way.
ps. would the bigger solution for this be to come up with some sort of offset based “infinite” coordinate system (not even sure where to start with that one!), such that the world space numbers don’t just keep incrementing endlessly until overflow?