Graphics3DLibrary, exposed on Context.graphics.
Properties
backend
Defined in: modules/graphics-3d/src/graphics-context.type.ts:32 Which backend runs.readonlybackend:Graphics3DBackend
camera
camera: Camera
Defined in: modules/graphics-3d/src/graphics-context.type.ts:22
The camera the scene is rendered with. A default PerspectiveCamera at
(0, 0, 5) looking at the origin; assign another camera to switch.
renderer
Defined in: modules/graphics-3d/src/graphics-context.type.ts:15 The Three.js renderer. Rendered by the library every tick; never callreadonlyrenderer:WebGPURenderer
setAnimationLoop.
scene
Defined in: modules/graphics-3d/src/graphics-context.type.ts:17 The scene rendered every tick — add objects here to show them.readonlyscene:Scene
Accessors
render
Get Signature
get render(): () => void
Defined in: modules/graphics-3d/src/graphics-context.type.ts:29
Draws one frame. The library calls it once per tick, after the systems,
and for editor screenshots. By default it renders scene through
camera. Assign your own function to render a post-processing pipeline
instead. Assign undefined to go back to the default. Reset on restart.
Returns
() =>void
Set Signature
set render(Defined in: modules/graphics-3d/src/graphics-context.type.ts:30render):void
Parameters
render
(() =>void) | undefined
Returns
void
Methods
raycast()
raycast(Defined in: modules/graphics-3d/src/graphics-context.type.ts:40 Objects under a point of the page, nearest first.clientX,clientY,objects?):Intersection<Object3D<Object3DEventMap>>[]
Parameters
clientX
number
Page x, in CSS px (PointerEvent.clientX).
clientY
number
Page y, in CSS px (PointerEvent.clientY).
objects?
Object3D<Object3DEventMap>[]
Objects to test, with their children. Defaults to the whole scene.
Returns
Intersection<Object3D<Object3DEventMap>>[]
worldToScreen()
worldToScreen(Defined in: modules/graphics-3d/src/graphics-context.type.ts:42 Where a world point is drawn in the page, in CSS px.point):ScreenPoint
Parameters
point
Vector3
Returns
ScreenPoint