-
Notifications
You must be signed in to change notification settings - Fork 19
concepts camera
Camera takes eye position, target position, up vector, viewport size and few more configuration options and provides the application with instructions what to render and where.
New instance of camera is acquired as Map::createCamera
.
Multiple cameras in single map are possible.
Use Camera::setViewportSize
to change the viewport size.
The width and height are in pixels.
It is used to determine which LODs should be rendered.
Can be set in two ways.
-
As a triplet of eye position, target position and up vector. They are given in physical SRS. When some resources needs to be downloaded, their priority is computed by their distance to the target given here. The distance between eye and target is further used when dealing with geodata.
-
As view matrix directly. The matrix is decomposed into eye position, forward vector and up vector. This will set the target position one meter (physical unit) in front of the eye, which may lead to reduced precision, especially when dealing with geodata. Use with care.
Projection parameters may also be set in two ways.
-
As a triplet of vertical fov (in degrees), near plane and far plane distances (in physical units).
-
As projection matrix directly. This allows eg. to create projections for individual eyes in stereoscopic rendering. Setting different projection matrices may lead to errors especially when dealing with geodata. Use with care.
Method Camera::suggestedNearFar
can be used to compute reasonably good near and far projection plane distances based on previously set view properties.
The returned values are based on the vertical distance of the eye from the surface.