I am doing a small project where I overlay data on the world. I have a plot. Now I want to realize the movement of the camera.
I have a code where, if the user holds c and drags the mouse, the camera position changes. The fact is that I'm not sure how to calculate the movement of the camera from the movement of the mouse.
This is the camera code for the default position: camera (width / 2.0, height /2.0, (height / 2.0) / tan (PI * 60.0 / 360.0), width /2.0, height / 2.0, 0, 0, 1, 0);
How to change the position of the camera relative to drag and drop? (I tried using mouseX and mouseY to compensate for the position of the camera, but this will not work.)
source
share