Skip to main content

KCamera

kds-plugin-document / Exports / KCamera

Interface: KCamera

酷大师相机 可以将酷大师画布中显示的内容,想象成从一个虚拟的照相机中看到的内容。可阅读任何计算机图形学课程资料,获取关于相机的基础知识。

The KCamera class contains methods for getting the camera information. The camera in KuDaShi is the “point of view” from which you look at the model.

Table of contents​

Methods​

Methods​

cancelZoomAnimation​

▸ cancelZoomAnimation(id): void

取消相机聚焦到对象的动画

Cancel the zoom animation.

Parameters​

NameTypeDescription
idnumberThe animation id.

Returns​

void

Defined in​

api.d.ts:1642


getMode​

▸ getMode(): KCameraMode

获取相机模式

Get the camera's mode.

Returns​

KCameraMode

The camera's mode.

Defined in​

api.d.ts:1577


getPosition​

▸ getPosition(): KPoint3d

获取相机位置

Get the camera's position.

Returns​

KPoint3d

The camera's position.

Defined in​

api.d.ts:1586


getTarget​

▸ getTarget(): KPoint3d

获取相机的观察点

Get the camera's target, which is the camera is pointing at.

Returns​

KPoint3d

The camera's target.

Defined in​

api.d.ts:1595


getUp​

▸ getUp(): KVector3d

获取相机向上方向

Get the camera's up direction.

Returns​

KVector3d

The camera's up direction.

Defined in​

api.d.ts:1604


getZoomFactor​

▸ getZoomFactor(): number

获取相机缩放比例

Get the camera's zoom factor.

Returns​

number

The camera's zoom factor.

Defined in​

api.d.ts:1568


setPosition​

▸ setPosition(position): boolean

设置相机位置

Set the camera's position.

Parameters​

NameType
positionKPoint3d

Returns​

boolean

The camera's position.

Defined in​

api.d.ts:1613


setTarget​

▸ setTarget(target): boolean

设置相机的观察点

Set the camera's target, which is the camera is pointing at.

Parameters​

NameType
targetKPoint3d

Returns​

boolean

The camera's target.

Defined in​

api.d.ts:1622


zoomToObject​

▸ zoomToObject(box, duration?): number

相机聚焦到对象

Zoom the camera to the object.

Parameters​

NameTypeDescription
boxKBoundingBox3dThe bounding box of the object.
duration?numberThe duration of the zoom animation.

Returns​

number

The camera's zoom factor.

Defined in​

api.d.ts:1633