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
.
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | options to configure frame3Dbase Properties
| |||||||||||||||||||||||||||
init3D | boolean | <optional> | true |
|
Classes
Members
camera :THREE.PerspectiveCamera
camera 3D
- THREE.
PerspectiveCamera
css3DRenderer :CSS3DRenderer
css renderer
- CSS3DRenderer
css3DScene :THREE.Scene
css scene
- THREE.
Scene
directionalLight :THREE.DirectionalLight|null
- THREE.
DirectionalLight |null
domElement :HTMLDivElement
root html
- HTMLDivElement
domElement3DArray :Array.<DomElement3D>
current domElements 3D in frame3D
- Array.<DomElement3D>
domElementCss :HTMLDivElement
root css (where css3Delement are added)
- 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 ?)
- HTMLDivElement
domElementWebGL :HTMLDivElement
root webgl (where canvas is added)
- HTMLDivElement
isRendering :boolean
flag to stop rendering 3D
- boolean
listeners :Object.<string, Array.<function()>>
listeners of Base.EVENT
- Object.<string, Array.<function()>>
renderer :THREE.WebGLRenderer
canvas renderer
- THREE.
WebGLRenderer
resizeListener :function
reference resize listener to remove it on dispose
- function
scene :THREE.Scene
canvas scene 3D
- THREE.
Scene
sceneConfig :SceneConfig
- SceneConfig
(static) EVENT
Events triggered by Base
Methods
appendDomElement3D(domElement3D, parent)
Name | Type | Description |
---|---|---|
domElement3D | DomElement3D | domElement3D to add in frame3D |
parent | THREE. | parent of the maskElement |
catchEventsCSS3D(value)
Name | Type | Description |
---|---|---|
value | boolean | 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}
- 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
Name | Type | Description |
---|---|---|
eventID | string | event to add listener |
listener | function | callback to call on eventID |
onResize(updateTHREEVariablesopt)
Resize frame3D
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
updateTHREEVariables | boolean | <optional> | true | camera and renderer should be updated |
removeDomElement3D(domElement3D)
Name | Type | Description |
---|---|---|
domElement3D | DomElement3D | domElement3D to remove |
render() → {void}
Render scene3D
- Type:
- void
renderCSS3D() → {void}
Render css3D
- Type:
- void
setRender(f)
Customize how to render the frame3D
Name | Type | Description |
---|---|---|
f | function | custom rendering function |