Class CM3View
CM3View Class
Class to manage a 3D view. This includes:
- Three.js camera
- Three.js Renderer which renders the scene into the camera (which is tied to the view's element)
- ViewingPlatform - optional platform to allow the camera to move indepenently from the direction of the platform.
Think of an airplane with a pilot, the plane is moving in one direction but the pilot can look in other directions.
- ViewingControls - these are based on the Three.js classes but modified to allow for spatial actions
For mulitple views, these need to move here:
- CanvasElement - the element the scene is displayed in
- CanvasContainer - the DIV that contains the canvas object. This is required to capture resize events and then resize the canvas element.
Settings Group: View3D
Setting |
Name |
Type |
Options |
Default |
Comments |
LookAt |
LookAt |
CMTYPE_VECTOR |
|
|
turns the view (really moves the camera controls) to look at the specified location |
ShadowMapType |
ShadowMapType |
CMTYPE_ENUMERATED |
"None", "Basic", "PCF", "PCF Soft", "VSM" |
None |
shadow type for the renderer, see https://threejs.org/docs/#api/en/constants/Renderer |
Object Functions
Object Functions
ZoomIn()
Zoom in to a higher resolution (map units are doubled relative to pixels)
ZoomOut()
Zoom in to a lower resolution (map units are halved relative to pixels)
ZoomToMaxBounds()
Zoom to the maxum bounds that have been set in the veiw
ZoomToBounds(NewBounds)
Zooms the view to the specified bounds. Selects a zoom level that will
contain the entire map.
Parameters:
NewBounds -
SetPosition()
Sets the camera to the specified x,y,z location in the 3D scene.
SetRotation()
LookAt()
Points the camera to the specified x,y,z coordinate