widthSegments
is created in the first part.Object.3D
must always be returned.const o = new THREE.Object3D();
. And it ends by adding a mash to this object and its returning: o.add(sphere); return o;.
get name() {
return text;
}
get name() {
return “New Object”
}
mesh
const make_mesh = () => {
const o = new THREE.Object3D();
const geometry = new THREE.SphereGeometry( 5, 32, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
const sphere = new THREE.Mesh( geometry, material );
o.add(sphere);
return o;
};
animate(delta) { // }
animate(delta) {
time += clock.getDelta();
// animation updates here
dispatch( events.update, { time: time, delta: delta } );
}
,destroy() { }
if(is_viewer){
controller.RemoveEvent('user_click', onclick);
}