Hi to all , and thank you for a great library.
I am currently creating a prototype that allows our system users to import assets onto a precreated environment.
Once imported , i create a UtilityLayer and a BoundingBoxGizmo
BABYLON.SceneLoader.LoadAssetContainer(My_ASSET_URL, "", scene.value, function (container) {
var meshes = container.meshes;
container.addAllToScene();
// Scale and position the loaded model (First mesh loaded from gltf is the root node)
meshes[0].position.set(initpos.x, initpos.y, initpos.z)
meshes[0].scaling.scaleInPlace(1)
var gltfMesh = meshes[0]
var boundingBox = BABYLON.BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(gltfMesh)
var utilLayer = new BABYLON.UtilityLayerRenderer(scene.value)
utilLayer.utilityLayerScene.autoClearDepthAndStencil = false;
var gizmo = new BABYLON.BoundingBoxGizmo(BABYLON.Color3.FromHexString("#dd5400"), utilLayer)
gizmo.attachedMesh = boundingBox;
// // Create behaviors to drag and scale with pointers in VR
var sixDofDragBehavior = new BABYLON.SixDofDragBehavior()
boundingBox.addBehavior(sixDofDragBehavior)
var multiPointerScaleBehavior = new BABYLON.MultiPointerScaleBehavior()
boundingBox.addBehavior(multiPointerScaleBehavior)
boundingBox.actionManager = new BABYLON.ActionManager(scene.value)
// Actions to listen to scale end, rotate end etc.
}
My question is what values should i be getting to be able to store onto my db , in order to reposition the same asset onto the edited place ?
I already tried a number of things by applying listeners for the gizmo.onRotationSphereDragEndObservable and for gizmo.onScaleBoxDragEndObservable , but i am lost into what exact values i need to store (boundingbox, sixDofDragBehavior, gizmo, gltf).
also please let me know if possible the correct way to render them on the specific position with rotation and scaling coming from db.
Thank you in advance