Can some one help me, how to get the bounding boxes info (values/ coordinates where my image has been on the scene).
I tried using
> var meshTask = assetsManager.addMeshTask("meshTask", [MeshNamePage_1, MeshNamePage_2], "assets/AR-3-4/", "Book_Perfect_Binding_MidOpen_BothCurve_ThicknessOffset.glb");
>
> meshTask.onSuccess = function(task){
> try{
> mapTexture(scene, pageTexture);
>
> const mesh = task.loadedMeshes[0];
>
> mesh.showBoundingBox = true;
> var bb = mesh.getBoundingInfo();
> var width = bb.maximum.x - bb.minimum.x;
> var height = bb.maximum.y - bb.minimum.y;
> var depth = bb.maximum.z - bb.minimum.z;
> //mesh.scaling = new Vector3(0.005, 0.005, 0.005);
> mesh.scaling = new Vector3(width, height, depth);
> }
> catch(error) {
> console.log("Texture mapping failed" + error);
> }
But getting (0, 0, 0) as the output, though I’ve image.
Just for reference - I’m using this image.
And here is the glb file i’m using
AR-3-4.zip (564.3 KB)
d