OGL Flight Simulation Distance Drawing

Started by
3 comments, last by Dredge-Master 19 years, 8 months ago
Hi, Please take a look at the following screenshot: http://forums.avsim.net/user_files/86837.jpg There are a few things about FSim's that I don't understand. Could anyone help me out with a few of these? 1. When specifying the drawing distance for an ogl window, for a FSim, should this distance be something like 10000 so that a really large distance can be seen or is there a limit? 2. When displaying/drawing terrain, which is positioned on the globe, are calculations required that use A: The latitude and longitude of your position on earth and B: A database that stores the latitude and longitudinal area that a specific file may contain as terrain or is there a different way that global terrain can be calculated and drawn? Thanks
Advertisement
1) Absolutly not, units are relative in openGl, meaning 1 unit can represent 1 inch or 1/2 a mile. You just want the far clipping plane to be fairly large RELATIVE to what your using. for example if a plane is 1.0 units long you might want a far clipping plane of 1000.

2) A: Sim's use flat land, and dont bother to have a curve, this makes it easy to get the x & z points and caclulate the corrisponding long/lat.

B: There are countless ways of storing and rendering terrian, do a search in google and you find more than you could ever want. Height maps are a good place to get started.
Thanks Skow.

Ok, I have one more question:

If my camera and my aircraft are at 0, 0, 0 and I am centered over my terrain, if I move my aircraft forwards over many miles of terrain and my camera follows the plane then does this mean that the camera and aircraft xyz values become very large or should I keep my camera and aircraft at 0,0,0 and move my terrain around the camera?
Good question, either way you want to avoid really large numbers as you lsoe the accuracy with floats. If you move the camera its numbers can get very high, and if you move the terrain, the vertex numbers will get high. This isn't a problem like I said untill you get really high. What I did when I made a terrain engine that allowed a really high travel is I divided it into chuncks, when ever the camera went from one chunk to another I translated all the chunks so the camera was over new chunk. I then moved the camera so it was in the correct place over the chunk.

Hope you understand what I mean.
You may want to use two projections.

One to render your terrain (or lack of in the case of the sky, unless you have flying mountains), and another just to render the aircraft.

the problem is when your clipping planes are not accurate enough, your aircraft frame and cockpit etc may start getting clipping problems, or z buffer fighting, and your shadowing may look quite bad.

So render once with a nice and accurate model of the aircraft in the current view. Now save that data, then change the projection and render the scenary.

Now dump the image of the plane (from the view of the pilot) over the rendered terrain.
Beer - the love catalystgood ol' homepage

This topic is closed to new replies.

Advertisement