setCameraReset

Sets the camera reset position.

Signatures

  •   Paramate.Viewport.setCameraReset( resetCamera )

Details

The camera reset position is a set of camera values that is applied to the camera when the resetCamera function is called. The camera reset position represents a 'home position' of a configurator's camera.

If automatic camera positioning is activated, the reset camera parameters are adjusted automatically whenever the model geometry changes. This is done in a way that provides the closest similarity to the former reset camera position.

Remark

In order to have an effect, setCameraReset() needs to be called after initialization of the configurator.

Example

 [...]
 configurator = new Paramate.Configurator({...});
 viewPort = new Paramate.Viewport({...});
 configurator.viewPort = viewPort;
 configurator.initialize( function(){
   viewPort.resetCamera({
     origin   : [ 0.0, 0.0, 0.0 ],
     focus    : [ 0.0, 0.0, 100.0 ],
     view     : [ 0.0, 0.0, -1.0 ],
     top      : [ 0.0, 1.0, 0.0 ],
     right    : [ 1.0, 0.0, 0.0 ],
     aperture : 30.0 });
   viewPort.resetCamera();
 });

 

Parameters

resetCamera

(optional) JavaScript object containing the reset camera position.

The object should contain the following properties:

Name Type Description
origin 3-vector (float array) Center of the camera rotation. Typically the origin lies close to the center of the 3d model.
focus 3-vector (float array) The actual position of the camera.
view 3-vector (float array) Camera orientation vector: the camera is heading into this direction. Must be orthogonal to top and right vector.
top 3-vector (float array) Camera orientation vector: defines the direction that points straight upwards (as seen from the camera's coordinate system). Must be orthogonal to view and right vector.
right 3-vector (float array) Camera orientation vector: defines the direction that points straight to the right (as seen from the camera's coordinate system). Must be orthogonal to view and top vector.
aperture float Camera angle of view in degrees.

If resetCamera is is omitted, the camera is set to the default reset position: the camera is placed on the negative Y axis, looking towards the origin (i.e. into positive Y direction), the +X axis points to the right and the +Z axis to the top of the camera.

See also