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.
Panning ArcRotateCamera | Babylon.js Playground (babylonjs-playground.com)
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
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.
The more I read the less I understand what we are doing here Thanks for kicking-in. I think this is beyond my expertise
I remember there was a classic sci-fi story where astronauts needed to explain the difference between left and right to some alien in order to survive
Yes, I remember this one too. Oldies like us do remember these things
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.