16 lines
350 B
JavaScript
16 lines
350 B
JavaScript
export class Element {
|
|
constructor() {
|
|
this.data = new THREE.Mesh(
|
|
new THREE.BoxGeometry(1, 1, 1),
|
|
new THREE.MeshBasicMaterial({ color: 0x00ff00 })
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Rotate the element
|
|
*/
|
|
rotate = () => {
|
|
this.data.rotation.x += 0.01;
|
|
this.data.rotation.y += 0.01;
|
|
};
|
|
}
|