ImFusion Web SDK

Camera

Models the extrinsic (position/orientation) and intrinsic (projection) parameters of a camera.

See

VolumeView#setCamera

Extends

Properties

PropertyTypeDescription
fovYnumberCamera vertical field of view in degrees. Setting this also updates the horizontal FOV with respect to the aspect ratio.
modeCameraModeThe intrinsic camera mode.
positionvec3The camera location in the world coordinate system.
upVectorvec3The camera's up direction vector in the world coordinate system.
lookVectorvec3The camera's look direction vector in the world coordinate system.

Methods

MethodDescription
setVectors()Set position, look vector and up vector at once.
setLookAt()Set eye position, look center and up vector at once.
glViewMatrix()Get the GlView view matrix describing the camera's parameters.

Inherited from ClassHandle

MethodDescription
isAliasOf()Returns true if this handle and other alias the same underlying C++ object.
delete()Releases this JavaScript handle.
deleteLater()Schedules this handle for deferred deletion and returns this handle.
isDeleted()Returns true if this handle has already been deleted.
[dispose]()Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually.
clone()Returns a new JavaScript handle aliasing the same underlying C++ object.

setVectors()

ts
setVectors(
   position: vec3,
   lookVector: vec3,
   upVector: vec3): void;

Set position, look vector and up vector at once.

Parameters

ParameterTypeDescription
positionvec3World coordinates of the camera location.
lookVectorvec3World coordinates of the camera viewing direction.
upVectorvec3Camera's up direction vector.

Returns

void


setLookAt()

ts
setLookAt(
   position: vec3,
   center: vec3,
   upVector: vec3): void;

Set eye position, look center and up vector at once.

Parameters

ParameterTypeDescription
positionvec3World coordinates of the camera location.
centervec3World coordinates of the point to look at.
upVectorvec3Camera's up direction vector.

Returns

void


glViewMatrix()

ts
glViewMatrix(): mat4;

Get the GlView view matrix describing the camera's parameters. View matrix is from OpenGL camera coordinate system to world.

Returns

mat4

On this page