I’m using the basic planes / dat.gui setup from the clipping planes stencil example.
I’m trying to have the plane rotate around it’s y axis (up) liek a swinging door with the “hinge” at the 0,0,0, with no gimbal lock, controlled by dat.gui.
having serious problems getting it to work. it should only rotate from 0 to 180 deg… but rotations in three.js are just so mind bogglingly difficult to do i don’t understand how anyone gets it to perform properly…
I have var planeSize, planes, planeObjects, planeHelpers, object;
// Planes Setup
var planeXvector3, planeYvector3, planeZvector3;
planes = [
planeMeshX = new THREE.Plane(planeXvector3 = new THREE.Vector3(-1, 0, 3), 0), // x
planeMeshY = new THREE.Plane(planeYvector3 = new THREE.Vector3(0, - 1, 0), 10), // y
planeMeshZ = new THREE.Plane(planeZvector3 = new THREE.Vector3(-3, 0, - 1), 0) // z
];
var params = {
gui: {
visible: true,
},
planeX: {
constant: 0,
negated: false,
displayHelper: false
},
planeY: {
constant: 0,
negated: false,
displayHelper: false
},
planeZ: {
constant: 0,
negated: false,
displayHelper: false
}
};
var folderTitle = mesh.name + ' planeX';
var planeX = gui.addFolder(folderTitle);
planeX.name = folderTitle;
console.log('planeX.name: ',planeX.name);
var minZ = THREE.Math.degToRad(-180);
var maxZ = THREE.Math.degToRad(0);
planeX.add(planeXvector3,'x',minX,maxX,1);
planeObjects = [];
var planeGeom = new THREE.PlaneBufferGeometry(planeSize, planeSize);
var planeGeomName = (mesh.name + '_planeGeom');
planeGeom.name = planeGeomName;
console.log('planeGeom.name: ',planeGeom.name);
var planeGeomVar = app.scene.getObjectByName(planeGeom.name);
console.log('planeGeomVar: ',planeGeomVar);