I've a tube geometry built with 2000 points stored as JSON data.
The tube has band (curves) also. I am using TrackBallControls
.
Now when I rotate the tube, it is rotated in all three dimensions. The rotation is not limited to any particular axis.
I am using following code after creating tubeMesh
.
// to make rotation only on x-axis
var v = new THREE.Vector3(1,0,0).normalize();
var matrix = new THREE.Matrix4();
tubeMesh.applyMatrix(matrix.makeRotationAxis(v, 0));
tubeMesh.applyMatrix(matrix.makeTranslation(0,-1500,0));
if ( tube.debug ) tubeMesh.add( tube.debug );
scene.add(tubeMesh);
This code does not work as the tube is rotating on all three dimensions. Even I've tried the functions defined in below question.
How do fix the rotation axis so that the tube will be rotated only on specified axis ?
using r53