View Full Version : infinite space?
06-29-2001, 08:17 AM
I was just wondering, if you create a model where you can move the view to anywhere, what happens when you keep moving the view farther and ferther away, approaching infinity? Is there some sort of built in space limit? There must be a limit to how big of a number the computer can use to compute your distance from the model or origin. What happens then?
06-29-2001, 09:02 AM
Yes, there is a limit, set by the precision of the GLfloat type. And you'll see really bad artifacts before even getting that far. For example, the density of usable values decreases as the values get large. So for really large coordinates you may be able to draw a point at (x,y,z) but not at (x+1,y+1,z+1).
06-29-2001, 09:10 AM
well, let me ask this: If I made a cube at the origin, and then while the program is running I move away from the cube (or move the cube away from me) until it reaches or surpasses the distance limit, the program isn't going to crash is it? WIll it simply not draw the cube? Will I be able to move the cube back towards me?
p.s. I realize I could just try all this out for myself, but I happen to be trapped at work for the day and these questions are bugging me.
06-29-2001, 09:16 AM
Oh, another thing, if you are actually wondering if it is possible to make an infinite space, yes it is. You can work around the problems I mentioned above by partitioning the space and using pseudo-random procedures to fill the world. And while the world itself will have infinite extent, it will not have infinite diversity. However using several different random seeds and/or generators instead of just one could greatly minimize the number of partitions that look the same (at least the number that any human would be likely to visit in his/her lifetime).
[This message has been edited by DFrey (edited 06-29-2001).]
06-29-2001, 09:19 AM
Beyond the limit, the program will likely crash, or at least throw up an error assertion claiming a floating point overflow has occured. Then again, if exception handling is disabled, then it could happen that the coordinates roll around, i.e. just beyond the largest value is 0 again.
06-29-2001, 04:14 PM
It could also become the max negative value, right?
06-29-2001, 04:27 PM
In the case of integers yes.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.