mirror of
https://github.com/seigler/webgl-threejs-hello
synced 2025-07-27 17:56:17 +00:00
⚡ Add post processing
This commit is contained in:
parent
f6494780c3
commit
c6580a8fe7
8 changed files with 123 additions and 45 deletions
28
app/js/components/Bean.js
Normal file
28
app/js/components/Bean.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
import props from 'js/core/props';
|
||||
|
||||
class Bean extends THREE.Object3D {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.radius = 1;
|
||||
const material = new THREE.MeshStandardMaterial({
|
||||
color: '#FFFFFF',
|
||||
});
|
||||
const geometry = new THREE.SphereGeometry(this.radius, 20, 20);
|
||||
|
||||
this.mesh = new THREE.Mesh(geometry, material);
|
||||
this.mesh.castShadow = true;
|
||||
|
||||
this.add(this.mesh);
|
||||
this.position.z += this.radius / 2 + 0.01;
|
||||
|
||||
this.onUpdate = this.onUpdate.bind(this);
|
||||
}
|
||||
|
||||
onUpdate() {
|
||||
// this.rotation.x += props.rotation;
|
||||
// this.rotation.y += props.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Bean;
|
Loading…
Add table
Add a link
Reference in a new issue