Archived

This topic is now archived and is closed to further replies.

Nibbles

rotation, stars and a universe

Recommended Posts

Nibbles    569
Hey, I finally got quaternion rotations working (up yours gimble lock!) Anyways, I thru in some stars and they rotate nicely and all, but with drawling 1 million stars+ to make it a big universe, that''s kind of slow. Did I expain that ok? and How do I get by this? Thanks, Scott Email Website
"If you try and don''t succeed, destroy all evidence that you tried."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
you can''t actually draw 1 million+ stars in realtime, for now anyway.

either wait a few years, draw less, or maybe have a texture with a few on it...

Share this post


Link to post
Share on other sites
Nibbles    569
oh, so maybe a skybox (starbox? ) and a few stars inside it to show movement?

Because my problem is, is that i''m just moving a camera around, not moving the objects.

thanks,
Scott

Email
Website

"If you try and don''t succeed, destroy all evidence that you tried."

Share this post


Link to post
Share on other sites
core114    122
it actually doesn''t matter if you are just moving the camera if there is perspective, that is if you do want to draw all 1 million each frame.

skyboxes along with a few actual stars gives a nice effect

then you could even use some sort of LOD to only show important stars if you have a huge space area that you were flying through... there are many ways to make it

Share this post


Link to post
Share on other sites
Shag    122
this is the million dollar question ... i''m doing a similar thing ... and my biggest limitaion is a 24 bit depth buffer! ... oh for 64 bit ...

however ... dreaming aside, the trick is to have varying coordinate systems ... depending on where you are actually flying! ... how you accompllish this is a matter of taste ... but believe me, it ain''t easy! i know!!!!

but for some sensible advive ... here''s what i did ... instead of having an entire galaxy to explore ... i decided on a globular cl;uster just outside of the galaxy! that way i''m getting away with about 2000 star do deal with in real time!

that was just a hint ... good luck!

Regards

Share this post


Link to post
Share on other sites
Shag    122
ok ... firstly i must say that from here on in this is theory - i''ve yet to implement it.

one problem is the enormity of stella space ... PC maths is too limiting to be able to accurately model even small regions of space without serious rounding errors ... don''t forget that a float is only accurate to 7 digits, and doubles to 15. i want to be able to fly around a solar system with a positional resolution of 1 cm (maybe i''ll up this to 10cm ... not sure yet). This mean distance to Pluto is 591,352,000,000cm ... that''s 12 digits already! as soon as you look at the closet stars rounding errors will be introduced.

my (theoretical) solution is the following. model a universe of a few thousand stars, perhaps using 100 units in OpenGl to represent 1 light year ... i will adjust those figures depending on what looks good. Draw these stars in a similar manner to a sky box, discarding the depth values. if you are near a star, use a different coordinate system based on the center of the star, and draw planets - but only if you are within a resonable distance to it ... otherwise you won''t be able to see anything anyway. the reason you can get away with this, is because you must use 2 entirely different systems for speed ... our nearest neighbouring star would take 4.2 years to reach at light speed - no one playing a game or a sim would wait that long. but if you want to include combat in your thingy, you mustfly at MUCH lower speeds, otherwise you wouldn''t ever see each other! therfore when traversing interstella space (using hyper-hyper-hyper-lightspeed), use the galactic coordinate system, and when bound to a solar system, use the solar coordinate system.

like i said ... those ideas are pure ramblings, based on nothing more than talking to a mate over a few beers ... it may or may not work ... but it the way i intend to go in the near future. I was going to model an entire galaxy split up into regions, and only drawing stars that were in adjacent regions ... but it looked crap - ideally you need to see the milky way effect in the centre of the galaxy, and using a texture was unrealistic.

Share this post


Link to post
Share on other sites
NewDeal    134
Funny Shag, been thinking about exactly the same things the last few days.

My dilemma is this: I would like the player to be able to fly, for example, around a planet (the solar coordinate system) in realtime. But if you look at earth which is approximately 42000 kilometers in diameter you will have to fly at a pretty nasty speed to accomplish this in a reasonable time (5 minute orbit would mean a speed of 140 kilometers per second).
Now take an enemy whip which is, lets say, 140 meters long. This ship will pass you in 1/1000 of a second , making combat impossible.

I really cant find a way to combine realistic object-sizes, with flying around in space(like between/around planets and such) in realtime.

As i see it, the only way is to jump between systems, planets and so on. The battles would then have to take place at some designated jump-point where all ships emerge.

I dont like this idea so please keep the input coming.

Share this post


Link to post
Share on other sites
Shag    122
ok ... like i have said before ... this is purely hyperthetical!

if you assume a large scale galactic coordinate system, you must be travelling at an emormous rate of knots! therefore the solar coordinate sytem isn't even worth bothering with! ie ... you'd fly past entire solar systems in no time at all!

therefore, you need the two coordinate systems! if you enter really fast mode, you don't need to worry about any solar system data ... but if you are close to a solar system ... then assume solar coordinates! it's not easy to implement ... but it is certainly do-able... like i saud this is only theory so far ... but i will persue it in the next few days ... watch this space!

PS ... that didn't make any sense ... (i'm pissed) ... but i hope you get the general idea!

Edited by - Shag on August 3, 2001 9:47:17 PM

Share this post


Link to post
Share on other sites
Wulf_    122
To shag:

"don''t forget that a float is only accurate to 7 digits, and doubles to 15"
"This mean distance to Pluto is 591,352,000,000cm ... that''s 12 digits already."

Yes and no. The approx limits for a double is +-1.0e+-308 or so. The 15 digit limit is *after* the decimal. Similarly, float offers something like +-1.0e+-38 with 6 digits after the decimal.

However, it can''t store the difference between 591,352,000,000.0002 and 591,352,000,000.0003, which is insignifigant. Floating-point stores values as exponentials. 591,352,000,000 is stored as 5.91352e+11. Once you pass 15 digit numbers, yes, doubles lose accuracy to a unit. To solve that, break up your space into smaller areas.

Anyway, don''t you think a goal of a 1cm resolution is a little unrealistic? After all, all your numbers will be rounded, except for the moon''s distance from earth (earth-sun distance isn''t exact, so this is off too). Also, all orbital mechanics will be off due to you being unable to calcuate all forces on an object. Finally, all masses for gravitational calcs will be, at best, gross estimates.

Good luck though.


To newdeal:

A 5-minute orbit is kinda fast, unless you''re doing sci-fi stuff.

Anyway, you''ll have a lot more than 1/1000 of a second to shoot at the enemy ship, about 1/4 of your orbit time (assuming they ar e headed at each other, can fire in any direction and are moving at about the same speed) Since there is no friction in space, you are free to shoot with anything, from beam to ballistic as soon as he comes over the horizon (or before, but that involves tricky orbital calculations )


To both of you:

How are you going to do the asteroid belt?

Share this post


Link to post
Share on other sites