Image ThreeAdapter
Import
js
import { ThreeAdapter } from 'monolook/image/three'Constructor
js
const adapter = new ThreeAdapter({
scene,
camera,
renderer,
showVideo: true,
container: document.body
})| Option | Type | Required | Default |
|---|---|---|---|
scene | THREE.Scene | Yes | - |
camera | THREE.Camera | Yes | - |
renderer | THREE.WebGLRenderer | Yes | - |
showVideo | boolean | No | true |
container | HTMLElement | No | document.body |
Methods
| Method | Returns | Description |
|---|---|---|
attach(tracker) | void | Connects to MonolookImage |
detach() | void | Removes listeners |
addARContent(targetId, object, options?) | void | Maps 3D object to target |
removeARContent(targetId) | void | Removes AR content |
setupVideoBackground() | void | Creates video background |
setup() | void | Configures background and camera after tracker.start() |
startRenderLoop() | void | Starts internal loop |
stopRenderLoop() | void | Stops internal loop |
destroy() | void | Cleanup |
addARContent options
| Option | Type | Default |
|---|---|---|
scale | number | 1 |
flipX | boolean | false |