The main camera constraint implementations are:
-
TLspAboveTerrainCameraConstraint3D
: to make sure that the camera always stays above the terrain. -
TLspLookAtTrackingCameraConstraint2D
: to look at a specific tracking point in 2D. This constraint also offers the possibility of following the orientation of the tracked point. -
TLspLookAtTrackingCameraConstraint3D
: to look at a specific tracking point in 3D. -
TLspLookFromTrackingCameraConstraint3D
: to look from a specific tracking point in 3D. This constraint implementation also allows you to follow the orientation of the tracked point.
Program: Adding a camera constraint to the view to world transformation demonstrates how to install a camera constraint on a view to world transformation.
samples/lightspeed/trackingcamera/MainPanel
)
TLspViewXYZWorldTransformation3D transformation = new TLspViewXYZWorldTransformation3D(aView);
transformation.addConstraint(new TLspAboveTerrainCameraConstraint3D());
The samples.lightspeed.limitnavigation.MainPanel
sample shows how you can create a custom camera constraint to limit navigation in the view. It contains a 2D and 3D constraint
that:
-
Limits the scale
-
Makes sure that the camera always looks inside an area of interest
-
Makes sure that he camera is oriented in such a way that North is always up