CanvasMap
Getting Started Tutorials 3D Reference

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.


Copyright (C) 2020, Humboldt State University, Jim Graham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see
.

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

ReturnsFunctionThrows
ZoomIn()
ZoomOut()
ZoomToMaxBounds()
ZoomToBounds(NewBounds)
SetPosition()
SetRotation()
LookAt()

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