Define the 'world' in terms of the 'ground' plus the z-axis

I am new to babylonjs and I am trying to draw a container that contains boxes.
In my perception, the container would be the ‘world’ and that world would be the ground plus a ‘ceiling’ and ‘walls’.

I read some docs and examples but it seems my understanding of the babylonjs world and walls and ceiling may be incorrect.
So I have some questions:

  • is the world in babylonjs term in any way limitable or is basically a result of the meshes in the scene?
  • if I want for example to draw a container : 10x15x20 to contain boxes of various sizes like 2x2x3, 4x4x5 etc, what would be the best way to design this so I can see if the boxes that I draw ‘fit’ in the container or stick out?

thanks for a great library, I already found it great fun to work with, just need to understand some things better that I found hard to find :slight_smile:

This was very helpful:

I am still curious to the answer to my questions to get a better understanding.

Hello and welcome!

I would say that ''world" is the illusion which includes everything what you see at the screen :slight_smile:

The best way to start with a 2D blueprint to understand positions and dimensions of your objects.
Here is small example of one big BOX (container) with some small box inside - Babylon.js Playground
I put a lot of comments there, feel free to ask more questions.

Hi and welcome.

Maybe this helps you. It’s somewhat simple, you only need to compare their bounding boxes, which represent the size W x H x D.

I am not quite sure I understand your question about the walls and ceiling. But if you need to check the sizes, using extendSize i simple way to do it.

Here is some example of just… well, some walls etc - https://playground.babylonjs.com/#0VHCTL#14 (seems that previous link was broken)

Move with WASD+Space

From reading your title I would note that in Babylon.js a world is better defined as ground plus Y axis. Babylon.js is a left handed system with y up.

thank you for the input, it clarifies a lot. Not sure about the ground plys Y axis, I see now what I thought of as a world may be not limited at all, or perhaps just by the total of objects drawn?

@labris that is an awesome example.
Here is my PG : https://playground.babylonjs.com/#KBS9I5#14840
What I meant with the world was what I made there with bounding boxes.

I think I can make what I want using that and the example @nogalo made.
Seems I need to read some more docs, your answers are a great way to explore more.

Thanks again, this is fun :slight_smile: