So I am creating a configurator, in which user can move rotate scale the 3D items which we have made editable via some logic.
Now since we have to use GLTF file format, while exporting them to glb the exporter creates a root node on each mesh. So should I load them into scene by changing the position of root or the first child of root. And when I apply the rotation gizmo ideally where should I place it on the root or the child?
Am I following the correct pipeline of loading assets in my scene i.e. All roots are at origin and the meshes under them are at different coordinates for example if there are two chairs in my scene both have their root at the origin but their actual position is at somewhere else.
So how to design scene then in this case, as root always goes on origin and my object is some other coordinate.
What I understood from you is that while exporting to glb the model and the root should be on the origin but then how should I design the level. as earlier I was embedding the object transform in the blender and the exporting but in this case all my objects will be at the origin with root
Also the rotation which I see in sandbox for a particular mesh when I applied it in the scene there is a an offset (Screenshot)
Maybe in Blender you should export your customisable meshes placed on [0,0,0] instead of their “real” place in the final scene. Then once in BJS you could apply their spawn position.
Little tips when importing a gltf: in the onSuccess callback you can rename the __root__ object, so as to get it more easily later (like here lines 30 & 85).
The rotation applied is due to different axys convention between Blender <> glTF <> BJS. You can even spot the Z scale of your root which is equal to -1.
Shouldn’t it be new BABYLON.Vector3 instead of new Vector3?