Methods
Shape
addShape
adds a shape to the scene example usage box shape const boxshape = { extents { x 0 5, y 0 5, z 0 5, }, position { x 1 0, y 1 0, z 1 0, }, type "box", }; const shapeid = viewer3d addshape(boxshape); circle shape const circleshape = { position { x 1 0, y 1 0, z 1 0, }, radius 1 0, type "circle", }; const shapeid = viewer3d addshape(circleshape); sphere shape const sphereshape = { position { x 1 0, y 1 0, z 1 0, }, radius 1 0, type "sphere", }; const shapeid = viewer3d addshape(sphereshape); parameters shape shape to add type required object yes box shape name type required description color string no color of the box extents vector3 yes box extents in meters id string no id of the box onclick function no function called when user clicks the box position vector3 yes position of the box type string yes value must be box onclick function called when user clicks the box type () => void circle shape name type required description color string no color of the circle id string no id of the circle onclick function no function called when user clicks the circle position vector3 yes position of the circle radius number yes radius of the circle in meters type string yes value must be circle onclick function called when user clicks the circle type () => void sphere shape name type required description color string no color of the sphere id string no id of the sphere onclick function no function called when user clicks the sphere position vector3 yes position of the sphere radius number yes radius of the sphere in meters type string yes value must be sphere onclick function called when user clicks the sphere type () => void return value id of the shape type string