What is the standard length unit in a scene

What is the standard length unit in scene, is it cm or m or else?
How to handle models coming from other programs in that respect?

The framework leaves that up to you. Anything otherthan meters with a WebXR camera is a mistake though.

If you need to scale some meshes to mix with others, be vary careful the origin of vertices is in the center. Scaling meshes with skeletons can also be an issue.

Pick the scale you want, but be consistent. You may need to tweak camera minZ / maxZ, but no big deal. Rescale things outside of runtime is advised.

Thanks a lot.

I am still confused about this subject.

My coleague creates models in Maya. I author a React + Babylonjs app that imports and edits/inspects models.
Some models are significanlty different when they are imported into these programs. Two different models, a shark (actually from BJS model archive) and a simple cube (created in Maya in cm mode) are scaled very differently. Shark is huge 150 squres and cube is as it is in Maya. In BJS app shark spans only 15 of grid squares length and cube is, as in Maya, 1cm.

What is the reason of this difference?

The reason is, I guess, programs like Maya HAVE a standard unit. In BJS, whatever is in the file is what you get.

Think this is more of a Maya or Maya export question. I know nothing about that.

Is there a thing that is in the BSJ scene object or somewhere else about the unit?
I am scanning the class docs etc, but could not see a thing so far.

The only one I know about is the implied unit for a WebXR camera in ‘immersive’ mode. There the camera is moved as you walk, in meters. If you had a 2 unit cube, it would appear as a walk in closet.

I see. Thanks a lot. Is there any other person to ping on this subject?

Maybe just wait till the US west coast gets to work. If they have anything to add, they do.

1 Like

They are not on yet :slight_smile:
I will keep looking though till that time.

There is no unit as @JCPalmer mentioned. The engine works with what you ask it to render. So the unit of your scene is the one you want (or the one coming from your file)

For instance, we can all say that this is the earth:

Or a ball :slight_smile: It will depend on how you want the camera to move, the other objects etc… Unit are purely relative

1 Like