Viewport Constructor

Constructor of the viewport object.

Signatures

  • Paramate.Viewport( object options )

Details

The function sets up the viewport inside a given HTML element. Parameters can be set inside the options object argument.

The viewport must be registered inside a configurator element.

Example

 [...]
 <body>
   <div id="viewPort"></div>
   <script type="text/javascript">
     configurator = new Paramate.Configurator({...});
     viewPort = new Paramate.Viewport({
       configurator: configurator,
       viewportElement: document.getElementById("viewport")
     });
     configurator.viewPort = viewPort;
     configurator.initialize();
   </script>
 [...]
 

Throw

error

Throws an error if the initalization failed.

Parameters

configurator

The configurator object (see configurator constructor).

onBeforeRedraw

Function to be called before a redraw operation is started.

onAfterRedraw

Function to be called after a redraw operation is finished.

useWaitAnim

Boolean flag whether a wait animation should be shown.

viewportElement

The HTML element that will host the viewport.

cameraOrbit

Boolean flag to enable/disable camera orbiting. (See also: setCameraOrbit, getCameraOrbit.)

cameraShift

Boolean flag to enable/disable camera shifting. (See also: setCameraShift, getCameraShift.)

cameraDolly

Boolean flag to enable/disable camera dollying. (See also: setCameraDolly, getCameraDolly.)

cameraPan

Boolean flag to enable/disable camera panning. (See also: setCameraPan, getCameraPan.)

cameraZoom

Boolean flag to enable/disable camera zooming. (See also: setCameraZoom, getCameraZoom.)

orbitMode

Possible camera orbiting modes:

"turn_and_flip" Movement that allows a combination of free rotation and flipping.
"turntable" The Z axis stays strictly vertical. The object cannot be turned upside-down.
"turntable_overturn" The Z axis stays strictly vertical. The object can be turned upside-down.

cameraAutoPos

Boolean flag to enable/disable automatic camera (re-)positioning.

cameraRealTime

Boolean flag to toggle between real time image streaming or the display of a rotation placeholder object.

cameraAutoRotate

Boolean flag to enable/disable automatic camera rotation.