Mathematics using information from the boundingbox find the center, width, height and depth of the boundingbox
For two meshes, meshA and meshB when
centerA.y > centerB.y meshA is above mesh B
when meshA is above meshB and Math.abs(centerA.x - centerB.x) < a limit and Math.abs(centerA.z - centerB.z) < a limit then meshA is directly above mesh B
when meshA is directly above meshB and centerA.y - centerB.y = (heightA + heightB) / 2 then meshA is touching meshB
Iâm sorry I didnât understand when I was loading the model, this callback, it returned 0 and 1, right, so I should also get the bounding box information of 1, right
Thank you very much!Yesterday I saw you gave me the calculation way, imagine I have ABCDE five squares, later, when I selected the starting square A should have A variable gain to block A bounding box of the information, then you should have A variable gain is the boundary of the block B, C, D, E frame information, and then two to compare and determine which block the Y axis is in the upper part of A square, and then choose to hide them
@Wingnut
SorryďźI need you help!
There are two sets of models in my PG. When I select a set of models, they will be hidden together with the second set of models. This is not what I want. My purpose is to select which set of models to hide only the top of the selected model. model https://playground.babylonjs.com/#U8MEB0#59
My function is that when I click on the first set of models, it will only hide all the models above the currently selected model, instead of hiding the other set of models https://www.babylonjs-playground.com/#3M7Q1U#22
This is my original example. There are two sets of models, building one and building two. When I click on the model of building one, he will hide the model of building two
Sorry!I canât delete all my content, it takes 14 hours to delete it again, so please close all my content, I just need help from others, but no one replied to me
I know of at least 4 people, including me, that have replied to you. Unfortunately you do not make what you want to do clear to us and so I stopped answering.
The picture has made things clearer I hope. I am giving you one method that gives one way to do what the picture says.
It is all about how you structure the data that describes your scene. A separate building needs separate code. If the same type of thing is happening to different building you could use a function to act on the different data.
I know, I have been perfecting the pseudo code that you and Raanaw gave me. When I still encounter new problems, it makes me confused. In the scene, I let the model know which layer he is, whether it is group A or B. Group building, but when I click on the model, I get the mesh object, I canât get its floor and build, and the method you told me before can only be used in scenes with less buildings. My project will load different models because of different models. Some may have one or twenty buildings. If each model is filled with floor array, it will take a lot of time, And, when I donât know how many sets of models I should add, I canât use this way anymore.https://www.babylonjs-playground.com/#3M7Q1U#31
I am testing âtoggle all layers above picked layerâ, there.
It uses multi-pick ray, shooting upwards from picked mesh. It works with ANY number of layers.
But⌠do we need to remove âtopâ of layer (with a click) so we can look at furniture inside?
If need to look inside layer, then⌠hmm. More difficult. Maybe right click⌠not sure.
Maybe I am FAR off-topic⌠but I still wanted to test up-aimed multi-pick Ray, for learning.