A default scene setup for three with a conway model that can be loaded.

Constructors

  • Construct the simple viewer scene

    Parameters

    • renderer: WebGLRenderer
    • scene: Scene<Object3DEventMap>
    • camera: PerspectiveCamera | OrthographicCamera
    • dimensionsFunction: (() => [number, number])
        • (): [number, number]
        • Returns [number, number]

    • options: SimpleViewerSceneOptions = defaultOptions

    Returns SimpleViewerScene

Properties

ambient: HemisphereLight = ...
camera: PerspectiveCamera | OrthographicCamera
dimensionsFunction: (() => [number, number])
light: DirectionalLight = ...
limitCSGDepth: boolean = true

Should we limit the CSG depth? Othwerwise we will only limit the depth of memoization.

maxCSGDepth: number = 20

The limit for CSG recursion depth (or memoization depth).

onload?: ((scene: SimpleViewerScene, object: default) => void)
orbitControls: OrbitControls = ...
renderer: WebGLRenderer
scene: Scene<Object3DEventMap>

Accessors

  • get ambientOcclusion(): boolean
  • Is ambient occlusion enabled?

    Returns boolean

    True if ambient occlusion is enabled.

  • set ambientOcclusion(value): void
  • Set if ambient occlusion is enabled.

    Parameters

    • value: boolean

      True if ambient occlusion is enabled.

    Returns void

  • get currentModel(): undefined | Model
  • Get the current model.

    Returns undefined | Model

    The current model.

  • get currentModelSceneObject(): undefined | default
  • Get the current model scene object.

    Returns undefined | default

    The current model scene object.

  • get hasAmbientLight(): boolean
  • Does this scene have an ambient light in it?

    Returns boolean

    True if the scene has an ambient light.

  • set hasAmbientLight(value): void
  • Set if this scene has an ambient light.

    Parameters

    • value: boolean

      True if the scene has an ambient light.

    Returns void

  • get lightDirection(): Vector3
  • Get the current light direction.

    Returns Vector3

    The current light direction.

  • set lightDirection(value): void
  • Set the current light direction.

    Parameters

    • value: Vector3

      The light direction (THREE.Vector3)

    Returns void

  • get shadowQuality(): ShadowQuality
  • Get the shadow quality for this.

    Returns ShadowQuality

    The current shadow quality.

  • set shadowQuality(value): void
  • Get the shadow quality for this.

    Parameters

    Returns void

  • get shadowsEnabled(): boolean
  • Are shadows enabled?

    Returns boolean

    True if shadows are enabled.

  • set shadowsEnabled(value): void
  • Are shadows enabled?

    Parameters

    • value: boolean

      True if shadows are enabled.

    Returns void

Methods

  • Load a new model, replacing any current model in the scene, uses promises/exceptions for error handling

    Parameters

    • model: default

      The model to add to the scene

    Returns void

  • Load a new model, replacing any current model in the scene, uses promises/exceptions for error handling

    Parameters

    • buffer: ArrayBuffer

      The buffer to load the model from

    Returns Promise<void>

    A promise to await on for loading.

  • Load an equirectangular environment map in HDR format.

    Parameters

    • url: string

      The URL to the HDR file.

    Returns Promise<void>

    A promise to await on for loading.

  • Returns void

  • Create a simple viewer scene, including the required threejs artefacts and attach it to a DOM element.

    Parameters

    • element: HTMLElement

      The element to attach to.

    • useElementDimensions: boolean = false

      If true use the width and height of the element, if false use the window dimensions.

    • options: SimpleViewerSceneOptions = defaultOptions

      The scene viewer options for attaching this element.

    Returns SimpleViewerScene

    The created scene.

  • Create a simple viewer scene, including the required threejs artefacts and attach it to a DOM element.

    Parameters

    • context: WebGLRenderingContext
    • width: number = 1024
    • height: number = 768
    • options: SimpleViewerSceneOptions = defaultOptions

      The scene viewer options for attaching this element.

    Returns SimpleViewerScene

    The created scene.