Overview
In this post discusses camera and camera data that is used in projections and animations.
It holds transformation information such as pitch, yaw and roll angles, translation, scaleby as well as Model, View and Projection matrix information of the 3D object.
Details
Coordinate System
OpenGL uses Right hand side coordinate system where +Z is pointing towards you.
BaseCamera
BaseCamera implements handlers for mouse and keyboard events. This is a base class that can be further specialized. It's located in VedaOGLLib\Scene\BaseCamera.h.
| Name | Description |
|---|---|
| windowrect clientrect | Upon events like resize, windowrect and clientrect are updated. windowrect stores window rectangle of the hosting window after calling GetWindowRect() method. clientrect stores client rectangle of the hosting window after calling GetClientRect() method. |
| mouseX,mouseY deltaX,deltaY | Upon mouse move event, the current X and Y coordinates are stored in mouseX and mouseY. Delta of X and Y coordinates are stored in deltaX and deltaY. |
| mouseLeftDown mouseMiddleDown mouseRightDown | Upon mouse button down event, one of these is set to true based on the button pressed. Rest are set to false. |
Methods
| Name | Description |
|---|---|
| CenterCursor | This method places the cursor at the center of the screen. |
| OnKey | This method handles keyboard input events. |
| OnMouseBtnDown | This method handle mouse button click events. |
| OnMouseMove | This method handle mouse move events. |
| OnMouseWheel | This method handles Mouse scroll wheel inputs. |
| UpdateWH | This method handles window resize events. |

