Summary
Methods:
calcCoordFromPixel |
像素坐标转世界坐标 |
calcPixelFromCoord |
世界坐标转到像素坐标 |
clearClipPolygon |
移除剪切范围,按照最大投影范围进行显示 |
destroy |
销毁 |
getFrustum |
获取视景体线,包括近裁面,远裁面,和边线 |
getProjectPolygon |
当前姿态下在地面上(z=0)的最大投影范围,倾斜角过大可能会导致不可预料的问题,可以使用getFrustum |
setClampToModel |
贴模型模式 |
setClipPolygon |
设置视频裁剪范围,仅适用于三维模型视频投影 |
setFocalLength |
设备焦距 |
setImageSize |
相片尺寸 |
setOpacity |
透明度。0-1范围 |
setPosition |
设置投影机位置 |
setRotation |
投影机姿态设置 |
setVideoSource |
重置视频源,并调用MathModel#updateVideoSource生效 |
Constructor
new VideoProjector(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
|
Methods
-
calcCoordFromPixel(pixelX, pixelY) → {Coordinate}
-
像素坐标转世界坐标
Parameters:
Name Type Description pixelX
Number pixelY
Number Returns:
Coordinate -
calcPixelFromCoord(x, y, z) → {Array.<Number>}
-
世界坐标转到像素坐标
Parameters:
Name Type Default Description x
Number y
Number z
Number 0 Returns:
Array.<Number> -
clearClipPolygon()
-
移除剪切范围,按照最大投影范围进行显示
-
destroy()
-
销毁
-
getFrustum() → {Object}
-
获取视景体线,包括近裁面,远裁面,和边线
Returns:
Object -{nearPlane,farPlane,ray} 视景体相关内容
-
getProjectPolygon() → {Polygon}
-
当前姿态下在地面上(z=0)的最大投影范围,倾斜角过大可能会导致不可预料的问题,可以使用getFrustum
Returns:
Polygon -
setClampToModel(flag)
-
贴模型模式
Parameters:
Name Type Description flag
Boolean -
setClipPolygon(polygon, blurRadius)
-
设置视频裁剪范围,仅适用于三维模型视频投影
Parameters:
Name Type Default Description polygon
Polygon 多边形,只取第一个闭合环
blurRadius
Number 5 边缘模糊半径,默认为5
-
setFocalLength(length)
-
设备焦距
Parameters:
Name Type Description length
Number -
setImageSize(width, height)
-
相片尺寸
Parameters:
Name Type Description width
Number height
Number -
setOpacity(opacity)
-
透明度。0-1范围
Parameters:
Name Type Description opacity
Number -
setPosition(x, y, z)
-
设置投影机位置
Parameters:
Name Type Description x
Number 投影机坐标
y
Number 投影机坐标
z
Number 投影机坐标
-
setRotation(yaw, pitch, roll)
-
投影机姿态设置
Parameters:
Name Type Description yaw
Number 方位角,取值[-360,360],单位度,正北方向为0度,逆时针为正;
pitch
Number 仰俯角,单位度,垂直往下为0度,通常大于45度;
roll
Number 翻滚角,单位度,一般为0度;
-
setVideoSource(source)
-
重置视频源,并调用MathModel#updateVideoSource生效
Parameters:
Name Type Description source
HTMLCanvasElement | HTMLVideoElement