Scene
class Scene
Scene that View3D will render.
All model datas including Mesh, Lights, etc. will be included on this
Properties
Methods
constructor
new Scene(view3D)
Create new Scene instance
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| view3D | View3D | An instance of View3D | 
Properties
root
Root THREE.Scene object
shadowPlane
Shadow plane & light
Type: ShadowPlane
userObjects
Group that contains volatile user objects
envObjects
Group that contains non-volatile user objects
fixedObjects
Group that contains objects that View3D manages
Methods
reset
Reset scene to initial state
Returns: void
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| options | object | ✔️ | {} | Options | 
| options.volatileOnly | boolean | ✔️ | true | Remove only volatile objects | 
add
Add new Three.js Object3D into the scene
Returns: void
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| object | THREE.Object3D | THREE.Object3D[] | THREE.Object3Ds to add | ||
| volatile | boolean | ✔️ | true | If set to true, objects will be removed after displaying another 3D model | 
remove
Remove Three.js Object3D into the scene
Returns: void
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| object | THREE.Object3D | THREE.Object3D[] | THREE.Object3Ds to add | 
setBackground
Set background of the scene.
Returns: Promise<void>
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| background | number | string | A color / image url to set as background | 
setSkybox
Set scene's skybox, which both affects background & envmap
Returns: Promise<void>
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| url | string | null | An URL to equirectangular image | 
setEnvMap
Set scene's environment map that affects all physical materials in the scene
Returns: void
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION | 
|---|---|---|---|---|
| url | string | null | An URL to equirectangular image |