Class: Viewer

ROS3D. Viewer

new Viewer(options)

A Viewer can be used to render an interactive 3D scene to a HTML5 canvas.

Parameters:
Name Type Description
options

object with following keys:

  • divID - the ID of the div to place the viewer in
  • width - the initial width, in pixels, of the canvas
  • height - the initial height, in pixels, of the canvas
  • background (optional) - the color to render the background, like '#efefef'
  • antialias (optional) - if antialiasing should be used
  • intensity (optional) - the lighting intensity setting to use
  • cameraPosition (optional) - the starting position of the camera
Source:
  • visualization/Viewer.js, line 21

Methods

addObject(object, selectable)

Add the given THREE Object3D to the global scene in the viewer.

Parameters:
Name Type Description
object

the THREE Object3D to add

selectable

(optional) - if the object should be added to the selectable list

Source:
  • visualization/Viewer.js, line 118

<inner> draw()

Renders the associated scene to the viewer.

Source:
  • visualization/Viewer.js, line 86