View Full Version : glOrtho(): a wimp?

04-11-2000, 08:01 PM
I'm working on a project, or at least starting to, that renders or scale-model of our solar system. The simplest solution for viewing seems to be using an orthographic view with the dimensions of our solar system. Instead of using the dimensions of our entire solar system, I just use the farthest out (clearly visible) object: Pluto. Now, all my planetary data is dynamically loaded from a .ini files where measurements such as distances of planets from the sun, radiuses of planets, orbits of planets, etc. are stored in km units. When I run my program with the correct solar system data, everything appears to scale, as it should, EXCEPT the planets are vertical lines! Thinking something was wrong with my glOrtho(), I rewrote my window reshaping function and got the same lines instead of spheres. Now, the funny thing is, when I go through my .ini file with all the stored values of planets' characteristics and scale them down to a size where the solar system is 100 by 100 by 100 and the planets have a radius between 1 and 10, the scene renders fine. No lines, real spheres! Why is it that when I use dimensions of objects from thousands to billions, but all to scale, the scene doesn't display correctly? I tried dividing all the inputted values from the .ini file by factors of 10, but that, oddly enough, didn't seem to scale down the solar system to an OpenGL-friendly size. Where do I go from here? I'm completely baffled.

Chris O.

04-11-2000, 08:15 PM
Just how big is the universe and how big are the spheres in my program? To give you an idea, the largest sphere is about as follows:

sphere( /*Radius*/ 71400, /*Sides*/ 100 );

and the glOrtho is roughly:

glOrtho( -5913607000, 5913607000, -1390001, 1390001 , 5913607000, -5913607000);

after the correct planetary dimensions are loaded from the .ini file. Hope that helps anyone in helping me, heh http://www.opengl.org/discussion_boards/ubb/smile.gif

- Chris.

04-12-2000, 01:57 AM

It wouldn't surprise me if this was a driver bug. Some drivers don't seem very stable at these very large scales (e.g. the Microsoft software render screws up if you try to do GL_CLAMPed texturing at stupid distances)

Another possibility - was that glOrtho call you posted directly from your source code? Only you specify the parameters as integers (replying on implicit conversion?), and parameters 1, 2, 5 and 6 are all outside the maximum range of a 32-bit int. Quite what this will do I've no idea, but I doubt if it's what you expect...