FormIt Plugin API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt.Cameras API

Description

Functions

json FormIt.Cameras.GetCameraData ()
 Get the parameters that define the current camera.
 
json FormIt.Cameras.GetCameraWorldForward ()
 Get the vector of GetCameraWorldForward
 
json FormIt.Cameras.GetCameraWorldPosition ()
 Get the position of the camera
 
json FormIt.Cameras.GetCameraWorldUp ()
 Get the vector of GetCameraWorldUp
 
json FormIt.Cameras.SetCameraData (cameraData)
 Set the parameters that define the current camera.
 
json FormIt.Cameras.AlignWithFace (facePath, withTransition)
 Set the camera to look straight at the given face and zoom to fit it.
 
json FormIt.Cameras.GetViewportSize ()
 Get the camera width and height Parameters: Out: width and height of the current viewport
 
json FormIt.Cameras.SetViewportSize (x, y)
 Set the parameters that define the current camera.
 
json FormIt.Cameras.SetProjectionType (projectionType)
 Set the camera to perspective.
 
json FormIt.Cameras.GetProjectionType ()
 Get the camera to perspective.
 
json FormIt.Cameras.SetPositionAndOrientation (aEye, aLook, aUp)
 Set the camera position and orientation.
 
json FormIt.Cameras.SetWorldForward (forward)
 Set the camera direction.
 
json FormIt.Cameras.SetFieldOfView (fieldOfView)
 Set the camera field of view (for perspective).
 
json FormIt.Cameras.Transition3DTo2DTopOrtho (duration)
 Transition the camera from a 3d view to top view and set the projection type to orthographic at the end.
 
json FormIt.Cameras.Transition2DTopTo3DPersp (altitudeAngle, duration)
 Transition the camera from a top view to a 3d perspective view, setting the altitude angle of the camera direction to the angle passed in.
 
json FormIt.Cameras.GetVerticalAngleLock ()
 Get the vertical angle lock Parameters: In: Out: bool vertical angle lock
 
json FormIt.Cameras.SetVerticalAngleLock (bLock)
 Set the vertical angle lock.
 

Function Documentation

◆ AlignWithFace()

json FormIt.Cameras.AlignWithFace ( facePath  ,
withTransition   
)

Set the camera to look straight at the given face and zoom to fit it.

Parameters
[in]facePathface to align camera with
[in]withTransitionif true, camera trasition is animated
Returns
sucess

◆ GetCameraData()

json FormIt.Cameras.GetCameraData ( )

Get the parameters that define the current camera.

Returns
WSM.Utils.CameraData

◆ GetCameraWorldForward()

json FormIt.Cameras.GetCameraWorldForward ( )

Get the vector of GetCameraWorldForward

Returns
WSM.Vector3d

◆ GetCameraWorldPosition()

json FormIt.Cameras.GetCameraWorldPosition ( )

Get the position of the camera

Returns
WSM.Point3d

◆ GetCameraWorldUp()

json FormIt.Cameras.GetCameraWorldUp ( )

Get the vector of GetCameraWorldUp

Returns
WSM.Vector3d

◆ GetProjectionType()

json FormIt.Cameras.GetProjectionType ( )

Get the camera to perspective.

Parameters: In: Out: projectionType

Returns
{...}

◆ GetVerticalAngleLock()

json FormIt.Cameras.GetVerticalAngleLock ( )

Get the vertical angle lock Parameters: In: Out: bool vertical angle lock

Returns
bLock

◆ GetViewportSize()

json FormIt.Cameras.GetViewportSize ( )

Get the camera width and height Parameters: Out: width and height of the current viewport

Returns
{ { "width" , to_json(width) }, { "height" , to_json(height) } };

◆ SetCameraData()

json FormIt.Cameras.SetCameraData ( cameraData  )

Set the parameters that define the current camera.

Set the parameters that define the current camera.

See GetCameraData for getting WSM.Utils.CameraData.

Parameters
[in]cameraDataWSM.Utils.CameraData
Returns
sucess

See GetCameraData for getting WSM.Utils.CameraData.

Parameters
[in]cameraDataWSM.Utils.CameraData
Returns
success

◆ SetFieldOfView()

json FormIt.Cameras.SetFieldOfView ( fieldOfView  )

Set the camera field of view (for perspective).

Parameters: In: double fieldOfView Out:

Parameters
[in]fieldOfViewdouble
Returns
JSON_UNDEFINED, i.e. {}

◆ SetPositionAndOrientation()

json FormIt.Cameras.SetPositionAndOrientation ( aEye  ,
aLook  ,
aUp   
)

Set the camera position and orientation.

Position is aEye. The view direction is defined by the vector from aEye to aLook. aUp is the up vector and should not contain any "roll", unless the camera points along the z direction (top or bottom view). It is actually ok to pass in (0,0,1) as the up vector for all cases, except when the view direction is pointing in the z direction. Parameters: In: WSM.Point3d aEye In: WSM.Point3d aLook In: WSM.Point3d aUp Out: bool true/false for success

Parameters
[in]aEyeWSM.Point3d
[in]aLookWSM.Point3d
[in]aUpWSM.Vector3d
Returns
{...}

◆ SetProjectionType()

json FormIt.Cameras.SetProjectionType ( projectionType  )

Set the camera to perspective.

Parameters: In: projectionType Out:

Parameters
[in]projectionTypeWSM.Utils.CameraProjectionType
Returns
JSON_UNDEFINED, i.e. {}

◆ SetVerticalAngleLock()

json FormIt.Cameras.SetVerticalAngleLock ( bLock  )

Set the vertical angle lock.

If true, orbit and swivel will only change the horizontal view direction Parameters: In: bool bLock Out:

Parameters
[in]bLockbool
Returns
JSON_UNDEFINED, i.e. {}

◆ SetViewportSize()

json FormIt.Cameras.SetViewportSize ( ,
 
)

Set the parameters that define the current camera.

Parameters: In: x, y Out: bSuccess

Parameters
[in]xint
[in]yint
Returns
JSON_UNDEFINED, i.e. {}

◆ SetWorldForward()

json FormIt.Cameras.SetWorldForward ( forward  )

Set the camera direction.

Parameters: In: WSM.Vector3d forward Out:

Parameters
[in]forwardWSM.Vector3d
Returns
JSON_UNDEFINED, i.e. {}

◆ Transition2DTopTo3DPersp()

json FormIt.Cameras.Transition2DTopTo3DPersp ( altitudeAngle  ,
duration   
)

Transition the camera from a top view to a 3d perspective view, setting the altitude angle of the camera direction to the angle passed in.

The camera must be in top view (looking straight down the z axis), otherwise nothing is changed and the return value is false. If the altitude angle is passed with a value outside -90 .. 90 degrees, set it to 30 degrees Parameters: In: double duration of camera transition In: double altitude angle for final camera direction Out: bool false if inital camera is not in top view, true otherwise

Parameters
[in]altitudeAngledouble
[in]durationdouble
Returns
{...}

◆ Transition3DTo2DTopOrtho()

json FormIt.Cameras.Transition3DTo2DTopOrtho ( duration  )

Transition the camera from a 3d view to top view and set the projection type to orthographic at the end.

The initial projection can be perspective or orthographic Parameters: In: double duration of camera transition Out:

Parameters
[in]durationdouble
Returns
JSON_UNDEFINED, i.e. {}