What scale when creating 3D worlds.

Blitz3D Forums/Blitz3D Beginners Area/What scale when creating 3D worlds.

Tobo(Posted 2009) [#1]
Dear all,

When designing worlds with a 3D program like 3D World Studio or 3DS Max, what grid size do you start off with?

If the default 32 size is used, it seems that only small internal maps can be created, as Blitz starts to cut off the view distance quite soon. However, if you cut the grid size down to 8,4 or 2, then you're limited by the amount of detail you can build into your map.

Would creating a map with a grid size of 32 work if you simply scale the loaded map mesh down by a factor of .25? Would that effectively mean that you created the map using a grid size of 8?

I have an outdoor map/project in mind, and, although I don't want to see miles, I would like to see further than your standard WW2 corridor.

Any handy hints much appreciated.

Many thanks.


Toby
PS. May I just be the first to wish you all a very merry Christmas.


Matty(Posted 2009) [#2]
I use Softimage:XSI Foundation - 1 XSI unit = 1 Blitz unit, as long as a consistent scale is used throughout it shouldn't matter.


Adam Novagen(Posted 2009) [#3]
as Blitz starts to cut off the view distance quite soon.

You should be able use CameraRange() to fix that.


Ross C(Posted 2009) [#4]
I think the generally used units are 1 meter = 1 blitz unit. But, as mentioned above, whatever scale suits. EDITED. See Stevie G's post below.

Bare in mind though, some people have encountered difficulties with collisions, when entities are moving a high speeds, so i wouldn't make your scale too big.


Stevie G(Posted 2009) [#5]
The ratio should be 1:1000 ( default camera range ) or less for best z-order accuracy.

You should really use whatever scale you like, 1 meter = 1 blitz unit isn't always appropriate.


Shambler(Posted 2009) [#6]
I use 1 unit=the smallest detail I want to model in a level which normally means 1 unit = 1 centimetre.

This is in a modelling application that can't display grids of less than 1 unit.


Ross C(Posted 2009) [#7]
1:1000? Cricky, that is small... :S

But for the reasonable scale, blitz collision fail more often if entities are travelling at higher speeds, thats why i suggested not going too high with them. If you use camerarange 1000,1000000 and move your units at 1000 units per frame, you have a higher chance of the blitz collisions failing.

Well from what i've seen of people reporting bugs with it anyways. Thanks for the proper camera range ratio though. I'll edit me post.


Ross C(Posted 2009) [#8]
Just read an article on z-buffer usage:

http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html


For another way to think about this, suppose we choose to think about the range at which there is a n% error in Z due to the precision of the Z buffer. For ease of discussion, I'll call the ratio of that range to the value of zNear 'Zn%'.

Hence, Z5% is the "range at which there is a 5% error in Z" divided by zNear.

For a 16 bit Z buffer, the value of Z5% is about 3500. It varies *slightly* depending on the value of zFar, and for very small values of zFar, it does get a little bigger - but for practical applications, 3500 is a good rule-of-thumb.

What this means in practice, is that if you place zNear at 1 meter (in whatever units your database uses), then when an object is at 3,500 meters, there will be a 5% error in it's Z value.



This guy seems to get the ratio at 1:3500. If i'm reading it correctly?


_PJ_(Posted 2009) [#9]
The ratio should be 1:1000 ( default camera range ) or less for best z-order accuracy.

I heard that too from ages ago...

Yeah, it is bloody small now looking at the kinda range it gives you.

If you use camerarange 1000,1000000 and move your units at 1000 units per frame, you have a higher chance of the blitz collisions failing.

Floating Point inaccuracies coming into play? I guess you were just giving an example, perhaps exaggerated for the point, but I wouldn't use such big numbers anyway :)

As for what the Absolute Scale should be, it really is up to you. I guess whatever 3D model program you have has a bearing on it, so go with what suits.

---------


Theoretically, seeing as any 3D models can be scaled even before they're imported, there's no reason why scales should ever be anything but 1:1000 or so is there???
Why would any other scales be used? Just for ones' own preference of being able to figure the maths etc? like.. "a man can jump 1 metre into the air" stuff?


fox95871(Posted 2009) [#10]
What about innacuracy the further away from 0 you get? You may notice for example in the Driver demo, if you make the terrain huge and then drive way out, everything gets all rattley because of the 6 pouint decimal thing. Doesn't that mean you should make everything tiny so you stay way inside that sphere of higher accuracy? I've always wondered about that, but haven't gotten around to testing it yet.


Ross C(Posted 2009) [#11]
I believe this has to do with the z-buffer, so using a certain ratio should solve that problem, but i believe to get round it completely, you should move your world around the 0,0,0 point if you get to far away.


Stevie G(Posted 2009) [#12]
Collisions have heehaw to do with your camera range! As fox95871 mentions, the further the colliding objects are from the world origin the less accurate the collisions are due to floating point inaccuracy.


Ross C(Posted 2009) [#13]
Is that in response to me, or fox, cause i'll feel daft replying :)


Kryzon(Posted 2009) [#14]
The problem with using 1 Max\Blitz unit as 1 metre is that it's tough modelling in this scale because Max's camera will start cutting away detail that is too close, like, less than 1 unit away from the camera. So, sometimes you want to get close to a certain corner or whatever and then you get too close to it, it just disappears because you went through it.
Also, the camera is very jerky and sensitive at this proximity.

Perhaps modelling everything 10 times it's size and then ScaleEntity level,0.1,0.1,0.1 in Blitz3D, simply to facilitate visualization in the modelling application.

About the Z-Buffer:
The problem isn't the yonder (far) value, it's the near one.

Using 1:500 or 1:1000 doesn't make a [practical] difference.

Now, using 5:1000, that changes something.

Try with this example:
http://blitzbasic.com/Community/posts.php?topic=85224

Put the camerarange on 1:500 and you will see it makes no difference at all. Hell, I just tried now, even 1:100 won't make a difference as well.

The Far value has a negligible influence on the final result. It's the near value you gotta worry about. Also, make sure to put your Camera's Zoom to the same value you have in your Near plane (say, a zoom of 5 if your Near plane is at 5 units from the camera).


jfk EO-11110(Posted 2009) [#15]
What Kryzon said. The smaller the near value, the more floating point artefact sawtheets aka z-fighting you'll see at longer distances.

People sometimes solve this limit with multiple renders, each with a certain Camerarange.
With only one camera you'll have the choice of:
-not to watch close things too closely
or
-not to allow any long distance views


But the scaling in the modelling app doesn't matter much. Just don't make it too small or too big to prevent floating point inaccuracies when it is rescaled in blitz. And your blitz app really shouldn't deny a scaling option.


Wings(Posted 2009) [#16]
iam using world space 10.000 x 10.000 max
and camera 0.1 to 200
scale everything by 0.1 all objects.

thoe i have issue with collisions getting bad. probably caues i scale using scale entity instead of scale mesh.

tiberion world map is 1024x1024.

every 1 unit is 2 meters.. cause iam making gigantic world to wander around.

problem get with zbuffer indeed. but collision works fine.

still i havent get perfect yet :)


Kryzon(Posted 2009) [#17]
I wonder if there is a Direct3D 7 RenderState that would help us. There are a lot of Z-Buffer related render-states.


Naughty Alien(Posted 2009) [#18]
..I always use 1 unit=1 meter, so everything i set in 3dsmax is accurate in game and based on that distances i need or anything else is easy to maintain..


jfk EO-11110(Posted 2009) [#19]
I just (re-)learned it often makes sense to use a scale that your lightmapping app can handle best. For example with gile[s] there is a certain minimal size to prevent lights from being cut due to not enough distance to a wall (might be a floting point issue, maybe it's just me). So I have to scale maplet meshes 10 times up for gile[s]. In 3dsm I guess it doesn't matter so much because the lightmapper is built in.