I am trying to rotate some meshes around the y-axis.
.rotation(…); doesn’t seem to work the whole 360 degrees.
I am using https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js
My code can be found at https://codepen.io/michielschukking/pen/NPxzPoB?editors=0010
const scene = new THREE.Scene();
const geometry = new THREE.BufferGeometry();
const vertices = new Float32Array( [
0, 0, 0, // v0
3.0, 0, 0, // v1
3.0, 5.0, 0, // v2
0, 5.0, 0, // v3
] );
const indices = [
0, 1, 2,
2, 3, 0,
];
geometry.setIndex( indices );
geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
const material = new THREE.MeshBasicMaterial( { color: 0x0000ff } );
const mesh0 = new THREE.Mesh( geometry, material );
mesh1 = mesh0.clone();
mesh2 = mesh0.clone();
mesh3 = mesh0.clone();
mesh4 = mesh0.clone();
mesh5 = mesh0.clone();
mesh1.rotation.y = THREE.MathUtils.degToRad(60);
mesh2.rotation.y = THREE.MathUtils.degToRad(120);
mesh3.rotation.y = THREE.MathUtils.degToRad(180);
mesh4.rotation.y = THREE.MathUtils.degToRad(240);
mesh5.rotation.y = THREE.MathUtils.degToRad(300);
scene.add( mesh0,
mesh1,
mesh2,
mesh3,
mesh4,
mesh5
);
renderer.render( scene, camera );
mesh2 up to mesh4 don’t work. Very strange, should I find another version of three.js?