[SOLVED] Unit system

Good day,
Now I am trying to understand jMonkey’s init system.

I have created a Box(100f, 5f, 100f). It is a square with 100x100 area and 5 height.
Then I have set up cam.setFrustumFar(100f).

I thought it means if I am staying on one edge of the box and looks at right angles to the side I must see the other edge. But it isn’t. I don’t see the half of my box, when I am at the edge of it. Why? The other edge must be rendered. Or units in Box's constructor and in setFrustumFar method are different?

In the absence of spatial scaling, the units of meshes and the units of camera frustums are the same. I call them “world units” because they can be meters, inches, light-years or whatever you choose to call them.

The camera frustum is measured from the current location of the camera. What’s rendered depends on where the camera is located and how it’s oriented in 3-D space.

By the way, Box(100f, 5f, 100f) actually creates a square that’s 200x200. The arguments are what I would call “radii” or “half-extents”.

As the documentation says:

The box has a center of 0,0,0 and extends in the out from the center by
     * the given amount in <em>each</em> direction. So, for example, a box
     * with extent of 0.5 would be the unit cube.
  • Ok, nice idea. I will cal them world units too :smirk:
  • Nope, I didn’t scale my Box
  • Can you please give me a link to this doc page?

https://javadoc.jmonkeyengine.org/com/jme3/scene/shape/Box.html#Box-float-float-float-

Hmm. Isn’t very informative… They have only written that cube initialized with 0.5 unit in every direction in fact will be 1 unit in every direction, as I have understood…
What means extent? One value uses to set length for all three axes?

Think about a sphere with a radius.

Box is defined the same way.

1 Like

Ohhhh. Thank you! Good comparison. I have understood))
Extent here is as radius for all three axes as I understand

1 Like

Yes, one extent per axis. xExtent, yExtent, zExtent.