Created
April 8, 2016 09:28
-
-
Save Colmea/a3d6a4acdef023c58897b4060deb1976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import React3 from 'react-three-renderer'; | |
import THREE from 'three'; | |
import {Timber as TimberComponent} from '../../../../core/components/Timber'; | |
export default class LongitudinalCut010 extends React.Component { | |
vertices: array; | |
faces: array; | |
constructor(props, context) { | |
super(props, context); | |
this.updateVertices(props); | |
} | |
updateVertices(newProps) { | |
this.vertices = [ | |
// update vertices based on props | |
]; | |
this.faces = [ | |
// update faces based on props | |
]; | |
} | |
componentWillReceiveProps(nextProps) { | |
// update geometry with new props | |
this.updateVertices(nextProps); | |
} | |
render() { | |
const {transformation} = this.props; | |
return ( | |
<mesh | |
ref="transformation3D" | |
visible={true} | |
> | |
<geometry | |
name={transformation.id} | |
vertices={this.vertices} | |
faces={this.faces} | |
/> | |
<materialResource resourceId={'transformationMaterial'} /> | |
</mesh> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment