1.2.1 • Published 3 years ago

three-dom-elements v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

three-dom-elements npm Minzipped npm License

A lightweight three.js extension to integrate DOM elements into your scene.

Usage

The following projects an iFrame into a threejs scene as a plane. You can use this plane as normal with techniques like raycasting, etc.

View the live demo.

Demo preview

import { DOMContext, DOMElement } from 'three-dom-elements';

// Create a DOM context to draw with
const context = new DOMContext(camera);
context.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(context.domElement);

// Create an element to project
const element = document.createElement('iframe');
element.src = 'https://threejs.org';
element.style.border = 'none';

// Project it
const element = new DOMElement(context, element);
scene.add(element);
1.2.1

3 years ago

1.2.1-beta.0

3 years ago

1.2.1-beta.1

3 years ago

1.2.1-beta.2

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago