Import
CSS3DRenderer is an addon, and must be imported explicitly, see Installation#Addons.
import { CSS3DRenderer } from 'three/addons/renderers/CSS3DRenderer.js';
Constructor
new CSS3DRenderer( parameters : CSS3DRenderer~Parameters )
Constructs a new CSS3D renderer.
parameters |
The parameters. |
Properties
.domElement : HTMLElement
The DOM where the renderer appends its child-elements.
Methods
.getSize() : Object
Returns an object containing the width and height of the renderer.
- Returns: The size of the renderer.
.render( scene : Object3D, camera : Camera )
Renders the given scene using the given camera.
scene |
A scene or any other type of 3D object. |
camera |
The camera. |
.setSize( width : number, height : number )
Resizes the renderer to the given width and height.
width |
The width of the renderer. |
height |
The height of the renderer. |
Type Definitions
.Parameters
Constructor parameters of CSS3DRenderer.
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
HTMLElement |
<optional> |
A DOM element where the renderer appends its child-elements. If not passed in here, a new div element will be created. |