Guest User

Untitled

a guest
Oct 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import {
  2. Mesh,
  3. IcosahedronGeometry,
  4. MeshBasicMaterial
  5. } from 'three';
  6.  
  7. import {
  8. MeshComponent,
  9. DynamicGeometryModule,
  10. Sphere
  11. } from 'whs';
  12. import {reactify} from '../../src/index';
  13.  
  14. import {DatGUI} from '../app';
  15.  
  16. @reactify
  17. export class ParametricSphere extends Sphere {
  18. constructor(params = {}) {
  19. params.modules = params.modules.concat([
  20. new DynamicGeometryModule(),
  21. DatGUI.Mesh({name: 'Sphere1'})
  22. ]);
  23.  
  24. super(params);
  25. }
  26. build() {
  27. const {material, geometry} = this.applyBridge({
  28. geometry: new IcosahedronGeometry(3, 5),
  29. material: new MeshBasicMaterial({color: 0xffffff})
  30. });
  31.  
  32. return this.applyBridge({mesh: new Mesh(geometry, material)}).mesh;
  33. }
  34. }
Add Comment
Please, Sign In to add comment