change rorate code

This commit is contained in:
casperlamboo 2017-12-05 11:10:17 +01:00
parent 84e28bc598
commit 95ba0cfeb1

View File

@ -160,10 +160,10 @@ class Interface extends React.Component {
}
};
rotateX = () => this.rotate(new THREE.Vector3(0, 0, 1));
rotateY = () => this.rotate(new THREE.Vector3(1, 0, 0));
rotateZ = () => this.rotate(new THREE.Vector3(0, 1, 0));
rotate = (axis, angle = Math.PI / 2.0) => {
rotateX = () => this.rotate(new THREE.Vector3(0, 0, 1), Math.PI / 2.0);
rotateY = () => this.rotate(new THREE.Vector3(1, 0, 0), Math.PI / 2.0);
rotateZ = () => this.rotate(new THREE.Vector3(0, 1, 0), Math.PI / 2.0);
rotate = (axis, angle) => {
const { mesh, render } = this.state;
if (mesh) {
const quaternion = new THREE.Quaternion();