Base

new Base(options, init3Dopt)

Basic Frame3D wrap different html element to handle CSS3D rendering CSS3DRenderer. It's possible to add DomElement3D to this. Composed with THREE.Scene + THREE.PerspectiveCamera + THREE.WebGLRenderer.

Parameters:
NameTypeAttributesDefaultDescription
optionsobject

options to configure frame3Dbase

Properties
NameTypeAttributesDefaultDescription
domElementClassstring<optional>

dom element class name

parentDomElementHTMLElement<optional>
document.body

dom parent element of domElement frame3DBase

catchEventsCSS3Dboolean<optional>
false

event are catch by css3D element (ie DomElement3D)

sceneConfigmodule:@ud-viz/utils_browser~SceneConfig<optional>

scene config

init3Dboolean<optional>
true

THREE.Scene + THREE.PerspectiveCamera + THREE.WebGLRenderer should be init

Classes

Base

Members

camera :THREE.PerspectiveCamera

camera 3D

Type:
  • THREE.PerspectiveCamera

css3DRenderer :CSS3DRenderer

css renderer

Type:
  • CSS3DRenderer

css3DScene :THREE.Scene

css scene

Type:
  • THREE.Scene

directionalLight :THREE.DirectionalLight|null

Type:
  • THREE.DirectionalLight | null

domElement :HTMLDivElement

root html

Type:
  • HTMLDivElement

domElement3DArray :Array.<DomElement3D>

current domElements 3D in frame3D

Type:

domElementCss :HTMLDivElement

root css (where css3Delement are added)

Type:
  • HTMLDivElement

domElementUI :HTMLDivElement

where ui element should be added (note that you have to handle manually z-index element composing ui, should it be automatically ?)

Type:
  • HTMLDivElement

domElementWebGL :HTMLDivElement

root webgl (where canvas is added)

Type:
  • HTMLDivElement

isRendering :boolean

flag to stop rendering 3D

Type:
  • boolean

listeners :Object.<string, Array.<function()>>

listeners of Base.EVENT

Type:
  • Object.<string, Array.<function()>>

renderer :THREE.WebGLRenderer

canvas renderer

Type:
  • THREE.WebGLRenderer

resizeListener :function

reference resize listener to remove it on dispose

Type:
  • function

scene :THREE.Scene

canvas scene 3D

Type:
  • THREE.Scene

sceneConfig :SceneConfig

Type:
  • SceneConfig

(static) EVENT

Events triggered by Base

Methods

appendDomElement3D(domElement3D, parent)

Parameters:
NameTypeDescription
domElement3DDomElement3D

domElement3D to add in frame3D

parentTHREE.Object3D

parent of the maskElement

catchEventsCSS3D(value)

Parameters:
NameTypeDescription
valueboolean

if true allow css3D html elements to catch user events, otherwise no

dispose()

Remove html from the DOM and stop listeners

initCSS3D()

Init the css3D renderer

isCatchingEventsCSS3D() → {boolean}

Returns:
  • false if root webgl is catching events, true if it's root css
Type: 
boolean

on(eventID, listener)

Register a listener on a Base.EVENT

Parameters:
NameTypeDescription
eventIDstring

event to add listener Base.EVENT

listenerfunction

callback to call on eventID

onResize(updateTHREEVariablesopt)

Resize frame3D

Parameters:
NameTypeAttributesDefaultDescription
updateTHREEVariablesboolean<optional>
true

camera and renderer should be updated

removeDomElement3D(domElement3D)

Parameters:
NameTypeDescription
domElement3DDomElement3D

domElement3D to remove

render() → {void}

Render scene3D

Returns:
Type: 
void

renderCSS3D() → {void}

Render css3D

Returns:
Type: 
void

setRender(f)

Customize how to render the frame3D

Parameters:
NameTypeDescription
ffunction

custom rendering function