Skip to content
Tomáš Malý edited this page Apr 27, 2018 · 5 revisions

Camera

For some application, the default navigation may not be applicable and you may want to have exact control over the camera. This is achievable through camera callbacks.

From inside the Map::renderTickRender a series of callbacks are always called, in the order in which they are listed here.

cameraOverrideEye

This callback allows the application to read the current camera eye position (based on the default navigation) or, optionally, to change the eye position.

cameraOverrideTarget

This allows to read and/or change the focus point of the camera. When used in conjunction with the default navigation, this point corresponds to the (objective) position point.

cameraOverrideUp

Here you may read or write (normalized) vector that corresponds to the local up direction.

cameraOverrideView

At this point, the entire view matrix is computed from the two points and up vector. This callback allows you to read the matrix or to arbitrarily change it.

cameraOverrideFovAspectNearFar

This callback allows to read and modify some of the most commonly used parameters for the projection matrix. The Fov is vertical field of view in degrees. The Aspect is ratio of viewport sides. And the Near and Far are distances in front of the camera at which the rendering will be clipped.

cameraOverrideProj

Finally, the projection matrix is computed and again provided to the application to freely change it.

Notes

All length units in these callbacks are in physical units (usually meters).

Clone this wiki locally