The 3D object created by assetcontainer. Addalltoscene() can be displayed completely, while the 3D object created by assetcontainer. Instantiatemodelstoscene() cannot be displayed if the angle is not right. I compared the difference between the two and found some rules，this is a 3D object created by addalltoscene(). Its area is like this:demo.zip (3.0 MB) ,Looking forward to your answer!
Unfortunately I can only answer part of your question
This is a bounding box gizmo used to rotate or scale the selected model.
In your first image you have selected the
_root_ node for the imported model, whereas in the second you have selected the
bot_root_0 node, hence the gizmo is in different positions. Both of these are parents to further nodes which you can view and select using the + next to them.
For the main part of your question, it would be easier to answer if you repro in a playground either using an available model Available Meshes to Import - Babylon.js Documentation or your own Using External Assets - Babylon.js Documentation
Thank you for your reply, the playground is here : https://www.babylonjs-playground.com/#4JTV9Z,Comparing two gizmo, this picture shows the gizmo of the non-clone entity:
This picture shows the cloned entity:
Using the Inspector you can clearly find the difference between the two. My problem now is that I do n’t know why the two are different. This may cause the model I copied can only see a part of it at a certain angle. Thank you for replying and looking forward to your answer. .
pinging @Cedric to see if he can help
I’m taking a look!
It looks like the BBox is not properly updated when cloning meshes.
Thank you for your help, so what should I do?
I’m doing more investigation. I think it’s a bug in the cloning code. I’ll keep you posted
thank you for your help！
@Deltakosh to me it looks like a rotation is not applied (or applied 2 times) when instantiateModelsToScene is called. Can you please point me where the transform datas are copied?
the rotation is supposed to be cloned here: Babylon.js/mesh.ts at master · BabylonJS/Babylon.js · GitHub
It looks like if the first node to clone and instanciate is not a mesh, the bounding box is not computed correctly. It’s skipped and BVH is not correct. Still investigating…
Excuse me, when will this be resolved?
As soon as I find something
It seems you need to refresh the bounding box computation by passing
true to the function (==“applySkeleton”):
Maybe it should be done by
Note the PG freezes when re-starting it, it’s fixed by:
I tried the following methods to solve my problem
The refreshBoundingInfo method you provided solved my problem perfectly, thank you for your help!
Thank you also for helping me.