Skip to main content

Scene

class Scene

Scene that View3D will render.
All model datas including Mesh, Lights, etc. will be included on this

constructor​

new Scene(view3D)

Create new Scene instance

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DAn instance of View3D

Properties​

root​

readonly

Root THREE.Scene object

shadowPlane​

readonly

Shadow plane & light

Type: ShadowPlane

userObjects​

readonly

Group that contains volatile user objects

envObjects​

readonly

Group that contains non-volatile user objects

fixedObjects​

readonly

Group that contains objects that View3D manages

Methods​

reset​

Reset scene to initial state

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
optionsobject✔️{}Options
options.volatileOnlyboolean✔️trueRemove only volatile objects

add​

Add new Three.js Object3D into the scene

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
objectTHREE.Object3D | THREE.Object3D[]THREE.Object3Ds to add
volatileboolean✔️trueIf set to true, objects will be removed after displaying another 3D model

remove​

Remove Three.js Object3D into the scene

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
objectTHREE.Object3D | THREE.Object3D[]THREE.Object3Ds to add

setBackground​

async

Set background of the scene.

Returns: Promise<void>

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
backgroundnumber | stringA color / image url to set as background

setSkybox​

async

Set scene's skybox, which both affects background & envmap

Returns: Promise<void>

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
urlstring | nullAn URL to equirectangular image

setEnvMap​

async

Set scene's environment map that affects all physical materials in the scene

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
urlstring | nullAn URL to equirectangular image

initTextures​

setDefaultEnv​