Visit the Documentation of the upcoming Threlte 6.
  1. @threlte/core
  2. CameraInstance

@threlte/core

CameraInstance

This module is deprecated. You can still use it but it will be removed in the future. Please consider using <T>/<Three> instead. Please read the update notice.

This component lets you use any manually instantiated object that extends THREE.Camera in threlte.

Import

Source

Github View Source Code

Package

NPM View Package

Related Docs


Example

<script>
  import { PerspectiveCamera } from 'three'
  import { CameraInstance } from '@threlte/core'

  const camera = new PerspectiveCamera(45, 1, 1, 1000)
</script>

<CameraInstance useCamera={false} {camera} />

Properties

// required
camera: THREE.Camera

// optional
viewportAware: boolean = false
useCamera: boolean = false
position: Position | undefined = undefined
scale: Scale | undefined = undefined
rotation: Rotation | undefined = undefined
lookAt: LookAt | undefined = undefined
castShadow: boolean | undefined = undefined
receiveShadow: boolean | undefined = undefined
frustumCulled: boolean | undefined = undefined
renderOrder: number | undefined = undefined
visible: boolean | undefined = undefined
dispose: boolean | undefined = undefined
userData: Record<string, any> | undefined = undefined

Bindings

inViewport: boolean

Events

viewportenter: undefined
viewportleave: undefined