Sunday, October 7, 2007

The Solution

The Solution:
The solution in a word... Grids! Ok, grids you say! Yep.
Now look at this example for number storage...
a INT(whole number)/FLOAT(floating point number) variable storing between -50,000.0 to +50,000.0 (ie 0.0-100,000.0) units. Where 1.0 unit = 100m , ie 10.0 units = 1km.
Now look at this...

Galaxy, Solar, Sector, Local
INT, INT, INT, FLOAT = 0 to 100,000,000,000,000,000,000,000 m

ie Sun to Earth would be 147,000,000km. Broke down to above grid would be...

Galaxy, Solar , Sector, Local
0 , 0 , 1470, 0.0 ie 1470 * 100,000.0 = 147,000,000km


100 Light Years would now be...

Galaxy, Solar, Sector, Local
0, 94608, 0, 0.0 ie 946,08 * 100,000 * 100,000 or 100 Light Years!


Problem solved, ok I might have to adjust the specifics and tweek values. But the idea is sound and can in theory store any number of ANY size just by adding more grid components.



With the Big number problem solved, I was able to start adding `Real Size` planets to my space scene. They are drawn by my custom Sphere generation routines in real time. They still need lots of nice Bumb Mapping, Multi-Textures etc etc...

No comments: