Hello, I would like to get your opinion on a problem that I cannot solve. I have two boxes. One of the boxes is movable and the other is immobile. My moving box moves around the stationary box.
What I want to learn is whether the stationary box stays on the right or left of the moving box. I hope I explained it in a simple way :). I request your help on the matter.
Lol. Interesting question. If I turn myself on 180Ā° then my left is to the former right, correct?
So, jokes apart, Iād say the left and the right depends from the point of view (or the look from the camera).
Assuming that your zero position would be the zero alpha of the camera, currently your object is neither to the left or to the right (from the zero alpha position of the camera) but behind it!
:). You are wrong. Your right is always your right. Think of it like your right arm :). The purple corner is to the right of the box. Because if we want to turn right, it turns in that direction. In the other corner is the left side :).
haha, yes. Bad usage of english language. Of course, my right is always to the right Thatās what I wanted to say when saying it depends from the view of the camera. But then I still donāt understand, what was your problem exactly?
power of the Translator :). With the simplest repair, I need to know that when I pass the motionless box, that box is on my left. Thatās all. Sorry for the translation mistakes
When you say āmy leftā, you mean from the view of the camera? or do you mean on the left x-axis?
Is your issue related to left-handed vs right-handed system? Iām sorry, I must be dumb.
Hopefully somebody else with a bigger brain than mine will kick-in
Please donāt insult yourself :). Itās just translateās fault :). When I say left side, I mean the left side of the box. So purple corner. My problem is that I donāt know how to find the answer :). The answer I want is; Is the white box to the left or right of the colored box? answer to your question
Donāt know what to say.
Below is what I see when I open your PG. For clarity, I added local axes to the boxes.
So, in my view scenario, the purple face is on the outter part of the object from the center object. The blue/azure part is facing the white cube object and the moving object is slightly displaced to the left on the x-axis. While the white cube is displaced to the right (positive value) on the x-axis from the zero world origin.
So, in short, Iād say that on the x-axis, the moving object is currently to the left (negative value) of the white cube. Thatās really all I can say.
In the PG that follows I have re-colored the box so that each side is clearly of a different color. I have also named all the side positions so they correspond to the front (green) of the box.
So currently in the PG the white box is on the right of the colored box. You cannot just say the white box is on the left or right without a reference to some other place or object with a known forward position.
In this image
the white box is on the left OF THE SCREEN
the white box is on the right OF THE COLORED BOX (as the green face is the front face)
If you decide to make the yellow side the front of the colored box then the white box would be in front of the colored box.
Dear Jedi mastes, itās a pity I havenāt found an answer, but itās good to see you having fun :). Iām still working on the situation. When I find a solution, I will share it with everyone. In all sincerity, thank you so much for trying to help. I love Babylonjs a lot :).
You can use two rays from box A, one going to the left and the other to the right. Depending on which of the two rays intersects the other box B, you will know where box B is in relation to A. You can also use multiple rays for each side if you want a more accurate detection.
see @farukcelim There comes the guru If he canāt do it, nobody can and we will likely just have to redefine the laws of geometry As for me, as everybody should know, Iām only here for the jokes Thatās what I do best Hope youāll find what you are seeking and meanwhile, have an awesome weekend