I generated a mesh using PlanGeometry and BasicMaterial.
function createMesh(width, height) {
let geometry = new THREE.PlaneGeometry(width, height);
let mat = new THREE.MeshBasicMaterial({
color: 0xffffff,
transparent: true,
side: THREE.DoubleSide,
opacity: 0.5
});
return new THREE.Mesh(geometry, mat);
}
Later on, I applied a transformation to this mesh in another part of the code. So
mesh.matrix.identify();
mesh.applyMatrix(matrix); // applied some transformation.
Now, I am trying to retrieve the size of the plane geometry I attempted the following method.
let boundingBox = new THREE.Box3().setFromObject(mesh);
let size = new THREE.Vector3(0,0,0);
size = boundingBox.getSize(size);
console.log('size', size);
Unfortunately, the size returned is incorrect. Is there a way to determine the width and height values used when creating the PlaneGeometry (width, height) initially?
let geometry = new THREE.PlaneGeometry(width, height);
I need assistance in retrieving the width and height values used in the above code snippet. Any help would be appreciated.