Advertisement

A question of scale...

Started by December 16, 2000 01:36 AM
8 comments, last by codetalker 24 years, 1 month ago
I''m trying to implement planet sized objects and car sized objects at the same time. Anyone have any idea how I could represent these with a consistent coordinate scheme that wouldn''t overrun the bounds of a float? My idea is to write a space combat sim that occurrs in orbit. Of course, the local planet is rather important in this respect. Thanks.
Use part of the float (or another) to represent an exponent. Then just use the rest as detail.
"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick
Advertisement
Size of space ship, ~ 100ft.
Diameter of earth, ~160,000,000ft.

They fit into floats just fine, I see problems brewing with absurd clipping fustrums...

Can''t the planet just be basckground art? If not you''ll need to do some programming that handles planet rendering differently than normal objects....

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
The planet "exists" in the game, space ships and objects will exist on the far side.
Floats will handle it. Objects are transformed from there cooridnate system to the world and eye cooridnate system. Precision will be lost on objects that are extremely far away where precision doesn''t matter.

Your real problem is the z buffer. A 24 bit z buffer will give you 16 million units. Assuming nearby spaceships need one inch accuracy, this gives you 16 million inches. That''s just over a million feet, or 200 miles. No spaceship over 200 miles away will be visible, so who cares?

Try this: Set your near clip plane to 200 miles and render everything with a depth accuracy of 100 feet or so. Then set your far clip plane to 200 miles, clear the depth buffer, and render everything 200 miles or closer with an accuracy of 1 inch.

I''m not sure if a seam would be visible where the 2 renderings meet.


_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
From what I''ve learned, the earth is 67 172 000 metres (3feet roughly 1 metre) across. I need a z range at least twice this since this is merely radius.
134 344 000 metres. + 2 * 200 000 m for various (allowable) orbital altitudes. OpenGl doesn''t like these numbers much.
I was thinking along the lines of drawing the the planet with a different fov on the projection matrix but I can''t really get my head around the ratios for translation in each view space (ie 100 units in ship space should be x units in planet space) The idea is that the game takes place in the upper atmosphere up to true outer space. I''ve tried using the riduculous numbers mentioned above and the results don''t look realistic and run like mollases on a cold day. Any vis testing on orbiting objects is a simple matter of vector/sphere intersections which are damnn fast. After that, the frustrum can handle it.

Advertisement
It seems you could use smaller planets with lower orbits. You really have no point of referance for how large the planet is, i.e. you can''t tell a small planet you are close to from a large planet you are relatively far away from. Planets are extremely small objects within extremely large voids. A space ship is tiny relative to both the moon and earth. Practically speaking how would the player know whether they are flying around a planet the size of the Earth or the moon.
Keys to success: Ability, ambition and opportunity.
I think what you needs to do, is use a trick on the planet. When the planet is further than some maximum distance away (10,000,000m?), you start moving the planet closer & scaling it down accordingly, so it appears just as if its getting further away. However, it the rendering pipeline, its staying put & shrinking. When you get really close to the planet, you'd what to switch modes, and do some dynamic texture twiddling so that you see more detail as you touch down. You're going to need some serious LoD models for the planet, and a corresponding pile of MIP maps. Like a thousand of them. You then run into the problem of actually generating a planet full of geographical data as well.

Edited by - Magmai Kai Holmlor on December 17, 2000 8:05:32 PM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I think I''ve found a solution. There are two types of space, one is planet space and the other is ship space. Movement in ship space is scaled down in planet space ie 100 space units is 1 space unit. Fooling with projection matricies fixed most of it.
The first suggestion was correct. First, set a really far
viewing frustum and draw only big things at that distance
(like planets). Then set a near frustum, and draw your
smaller stuff. You should NOT change fov or anything else
of your frustum; only the near/far planes. This will make
the rendering be seamless.

That way, it''s the same projection, just different clipping,
so it all matches up. Real-life space, however, is VERY
VERY LARGE compared to anything man-made, so a game with
realistic scales will have to be all about scanner/radar
screens, rather than heads-up projection...

This topic is closed to new replies.

Advertisement