i5-tk-webxr
Version:
The i5 Toolkit for WebXR is a collection of utilities that help to develop WebXR applications that are build with three.js.
18 lines (17 loc) • 550 B
JavaScript
import * as THREE from 'three';
export class LoadingIndicator {
constructor(xPos, yPos, zPos, scale) {
this.xPos = xPos;
this.yPos = yPos;
this.zPos = zPos;
this.scale = scale;
this.cube = new THREE.Mesh(new THREE.BoxBufferGeometry(scale, scale, scale), new THREE.MeshLambertMaterial({ color: 'red' }));
}
addToScene(scene) {
this.cube.position.set(this.xPos, this.yPos, this.zPos);
scene.add(this.cube);
}
render(time) {
this.cube.rotation.y = time / 1000;
}
}