componentDidMount(){
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
var cube = new THREE.Mesh( geometry, material );
cube.rotation=this.state.cubeRotation;
this.refs.scene3d.add( cube );
}
It works. Then I want animate it
onAnimate(){
var rot = new THREE.Euler(Math.random()*2,0, 3);
this.setState({ cubeRotation:rot });
}
but it doesn't work
I know that I can create box in this way
if I create box in this way
It works. Then I want animate it
but it doesn't work I know that I can create box in this way
But I have to create some meshes runtime and animate it. Can you help?