Camera

Camera

new Camera()

Description:
  • 摄像机是一个三维空间中的投影点,它表示当前视口所看到的内容。主要由引擎内部处理,不需要手动创建。 可以通过engine.camera上绑定cameraChange事件来实时获取当前摄像机的参数。
Source:
  • three/Camera.js, line4

Methods

setConstrainPolygon(polygon)

Description:
  • 开启平面区域限制, 如果传入大于3个点,则使用多边形限制,如果少于2个点,则不限制,默认不限制
Source:
  • three/Camera.js, line222
Parameters:
Name Type Description
polygon array [[lon,lat],[lon,lat],[lon,lat],[lon,lat]] ,可以使用一个多边形,至少3个点,数据是经纬度的

setConstrainShape(constrainHeight, shape)

Description:
  • 开启立体区域限制,开启前建议先确保相机不在限制区外。
Source:
  • three/Camera.js, line239
Parameters:
Name Type Description
constrainHeight number 最大限制高度,单位米,默认-1, 不限制
shape array [[lon,lat,alt],[lon,lat,alt],[lon,lat,alt],[lon,lat,alt]] ,至少3个点,数据是经纬度的