Advertisement

Position & Object Scale

Started by February 18, 2021 02:15 AM
3 comments, last by frob 3ย years, 11ย months ago

I'm trying to learn the low level components of computer graphics. I'm stuck on what seems like a basic concept. So I understand that I use the matrices to manipulate the vertices and translation between the different spaces. The piece that just isn't clicking for me is how do I define the size of my scene. So if I make a cube that goes from -1 to 1 on each axis how do I know how big that is relative to my scene?

So for example if I had a scene that was 1 mile and I wanted to make a cube that was 5 ft in every dimension what would that look like?

Thanks in advance for your responses.

First you need to define what 1 unit in your world is equal to. I think most game engines use 1 unit = 1 meter but you can use 1 unit = 1 foot. In that case, your cube would be 5 units square.

What would be the โ€œscaleโ€ of a number line if you are measuring your height? You can see that the scale of the number line is actually based on what measurement unit you choose to use. Of course a number line has no scale outside of what meaning you give it. It is the same with a 3 dimensional number line(s).

Your scene size is boundless. Kind of. It is limited to the floating point precision errors that start to creep in when you use very large or small values and especially when you do math with both very large and very small numbers. I don't think 1 mile in feet units would cause any single precision floating point (32 bit) errors as long as you don't do math involving very small numbers. Even then, most math is calculated around the world origin and isn't a problem.

I don't know what the limits are. I say don't worry about it but be aware some things might start acting wonky if you anger the floating point gods.

๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚<โ†The tone posse, ready for action.

Advertisement

<merged posts>

๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚<โ†The tone posse, ready for action.

1.0 = 1 meter is quite common, as Fleabay pointed out.

If you limit the displayable world to ~4 kilometers around the origin, that gives you a floating precision of about 1 millimeter when you're out near the limits. An 8 kilometer diameter orb is enormous if you stop to think about it in physical terms.

If you've got a simulation that needs more precision than that, or that needs more area around the origin than that, you'll need to go for a more complex solution.

This topic is closed to new replies.

Advertisement