Mesh adds bounding boxes

ladies and gentlemen, I’d like to know when I have hundreds of grid scenario, they are all building floor, I need to give each floor, add bounding box, how should I add, and, when I click on the icon of present construction model, how to obtain the current whether it floor mesh and interact, if there is interaction, will hide them

Sorry but not sure to understand the question :frowning:
Can you try to do a simple pg that helps us understand better?

http://120.78.84.216/Rec%200001.mp4

  • What I need to achieve is such a linkage effect

I feel dumb but I do not get what you want. Your video shows us that when you click on an object in your treeview you see specific meshes right?

What do you want to do beside that?

Give each mesh on a floor a parent, when mesh clicked on make its parent invisible https://www.babylonjs-playground.com/#MECK03#5

2 Likes

Thanks @JohnK i was completely lost!

About 1 point, click on the tree, you will only see the model and the model in the case of the current node, the model will be hidden, it is just like a display page, there is a building, tree node displays is the details of each layer, would you like to see more clearly, you click on a floor, move the camera to the location of the nearby, which layer and will be displayed (including the following), will choose to hide the floors above

1 take a look at your example, kind of like, but instead of clicking on a layer to hide itself, select the floor above it to hide

https://www.babylonjs-playground.com/#MECK03#6

thank you!I think you’ve seen the video I posted, so it’s actually hiding all the top models of your selected models, not just the top layer, because it doesn’t make any sense in the scene.So I would like to know how I should implement this feature in my own scenario

https://www.babylonjs-playground.com/#MECK03#7

click hide, click show

ha ha!Thank you, you wrote this really good, but I accidentally found a problem, is the video problem!It should be a matter of algorithm and judgment, but it’s really great, I didn’t do it!And how do I write an algorithm that pulls the camera position close to the model, so that it gets to the front of the model but doesn’t get too close

corrected (I hope :slightly_smiling_face:) https://www.babylonjs-playground.com/#MECK03#8



yes, I tested your work on the side. It was great!But I’m not sure if it works if I use my own scenario, because you seem to be adding a parent node to each box, and this is how I load it, and it doesn’t seem to conflict, and I need to add a transformNode to each model as well?Another is, want to ask you, this is a math problem, when I click on the model, how to set the camera position near to click on the model, but not close to the model, just close near the location model, and only in the front, even if I put the camera around the back into the model, click on the model, the camera will return to the front of the model, toward the model, it should be a math question, I’m sorry, I think along while, test and has a problem, I think that model the current position + front direction

Possibly Yes

Your first question.

Hopefully I given one method to answer this question. You could see if you could adapt this for your project. I suggest that instead of the boxes you load the rabbit (from this PG https://www.babylonjs-playground.com/#QY1WYT#104) and see if you can change PG #8 that I gave you to work with the rabbit in place of a box. Once you have tried this come back with your playground if you have a specific question about that playground.

This is a different question and should be in a new topic. The best way to ask is with a PG containing a box and ask the questions above.

how to say, if I add a box to each model, I need to set the location of each box, and I have nearly 100 grids in my scene, so this is a lot of work

Do not add a box to each model.

To ask questions make a simple scene with boxes instead of models.

In your project use models.

To ask questions using import make a simple playground using a playground model like the rabbit.

Here is the same playground using imported model not box https://www.babylonjs-playground.com/#MECK03#10

Thank you!
http://www.hightopo.com/demo/Simple3DEditor/index.html
I found an example where he clicked on the model and zoomed in the camera. I don’t know if it can be used for reference

I’m using importAsync on my project, which is I have too many models for me, it’s better to load them asynchronously

https://www.babylonjs-playground.com/#MECK03#11

1 Like