Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {
- Mesh,
- IcosahedronGeometry,
- MeshBasicMaterial
- } from 'three';
- import {
- MeshComponent,
- DynamicGeometryModule,
- Sphere
- } from 'whs';
- import {reactify} from '../../src/index';
- import {DatGUI} from '../app';
- @reactify
- export class ParametricSphere extends Sphere {
- constructor(params = {}) {
- params.modules = params.modules.concat([
- new DynamicGeometryModule(),
- DatGUI.Mesh({name: 'Sphere1'})
- ]);
- super(params);
- }
- build() {
- const {material, geometry} = this.applyBridge({
- geometry: new IcosahedronGeometry(3, 5),
- material: new MeshBasicMaterial({color: 0xffffff})
- });
- return this.applyBridge({mesh: new Mesh(geometry, material)}).mesh;
- }
- }
Add Comment
Please, Sign In to add comment