Solar System Model Project

Community Forums/Graphic Chat/Solar System Model Project

-Rick-(Posted 2004) [#1]
My 6 yr old daughter expressed interest in Astronomy and I was looking for a project to wet my interests in programming again. Here are a few screenshots so far.

One of Jupiter's Moons with Jupiter Backdrop


Approaching Neptune with Orbit Rings turned off


Neptune with Orbit rings on


Earth and Moon


Uranus and its moons


Scimming across Uranus's moons toward its Moon Portia


A shot with Orbit Menu open and listing all Jupiters Moons



poopla(Posted 2004) [#2]
Looks pretty cool.


Ruz(Posted 2004) [#3]
nicely done


big10p(Posted 2004) [#4]
Really nice! How are you drawing the orbit rings?


-Rick-(Posted 2004) [#5]
Real crappily, heh. I just created a sprite and blew it up. I absolutely hate it. I've actually got information for the ring systems of Saturn and Uranus, but I wasnt sure how to implement the data (I can also get the data for Jupiter if I decide to implement) yet. The name, distance from the planet, and width of the individual rings are on hand.

I'm not sure how to create a mesh on the fly and all my attempts at actually making one have turned out rather bad so far.

<EDIT>
Doh, you asked about the 'ORBIT' rings, I thought you meant planet rings for some odd reason.

I'm using a code snippette from the archives to create a torus. It works great if you are close, but there is a slight loss of accuracy when sizes go up. The dont line up with the planets/moons quite right and the further from their pivot point (the sun for the planets, the planet for the moons) the more odd graphic effects you get. They tend to flicker and vanish as you move away from them. I'd really like to find another way of doing it - like perhaps drawing them directly to the 2d portion of the screen if I can figure out a way.


Bot Builder(Posted 2004) [#6]
Yeah very cool. I especially like the last one. As far as the lines go, you might try using this - http://www.blitzbasic.com/codearcs/codearcs.php?code=839

Requires an extra render pass, but its not to bad.


big10p(Posted 2004) [#7]
[edit] lol. bot builder beat me to it! :P

Ah, I see. That method must be using alot of polys though, isn't it?

They tend to flicker and vanish as you move away from them.

That's probably because the ring meshes are very 'thin' and become too thin to render properly when far away from the camera.

I'd really like to find another way of doing it - like perhaps drawing them directly to the 2d portion of the screen if I can figure out a way.

I don't think drawing the rings with 2D is going to be a solution. The rings need to be z-buffered so that they're not visible when they go behind the planets, etc., yes?

One solution may be to use 3D lines. Below is a simple demo of this.

The up-side to this method:
- the rings (should) always render properly, no matter how far away they are (no flickering).
- uses minimal amount of polys.

Possible down-side:
- requires a 2-pass render: 1 in wireframe mode and 1 in normal, solid mode.

Anyway, let me know if it's of any use. :)




-Rick-(Posted 2004) [#8]
Hey, great! Thanks for that snippette I'll give it a try and post the results.

The flickering isnt related to z-order so much as the distances involved. To solve the problem with the planets I actualy normalize my environment back to 0,0,0 once I move a set distance from that point. That works great for things that are close by, but the mesh orbit rings are so large that their center is still located way far away so I start getting inconsistencies. i can actually fix this by increasing the size ratio of my whole model, however then i suffer on the opposite end with things being too small (the moons) and i get a bad shaking effect from loss of accuracy in the float. Its definatly a tight rope heh. Alternate ways of doing things are always welcome :)


-Rick-(Posted 2004) [#9]
I didnt have much luck. Gotta understand I'm way new at all this so plugging in the code can be tricky at best. I dont even know where to start to describe my troubles lol.

I dont think the double render is a problem - I already do this in certain portions of my program where I'm zooming in on something. I dont want my skybox zooming as well so I render that, hide it, then render everthing else normally.

The poly count on the orbit rings is pretty high as you imagine, so I'd love to use this line method. I'm sure the problem I'm experiencing is my lack of experience in planting the code correctly into my program.


-Rick-(Posted 2004) [#10]
Lil update. I actually managed to get it plugged in somewhat. I'm getting the orbit lines and they look good. Still got that loss of floating point accuracty. Still a few other z-order issues to work out too as things flicker tween whole and meshed.


-Rick-(Posted 2004) [#11]
I'll keep this method in mind. After tickin with it for a bit I discovered that I was taking a pretty good hit on FPS - however I think that may have only been because of my hack job to get it put in.

The second reason, and more important, is that I still suffered from the same graphics problems that the torus gave me. My environment is just too big for these things. To really lick this problem i think I'd need to rework my base code so as not to go with actual distances (even if mangled by ratios) and work out some trick system so that the observer THINKS they are traveling from gods end to gods end while actually all the objects and distances where kept within in more tollerable ranges.

Thanks for the help, advice, and code tho!


Agamer(Posted 2004) [#12]
Are you going to release it, not the code but the compiled version as I would like to have a look at it!


-Rick-(Posted 2004) [#13]
heh, i really want to, but its like everytime I think I'm ready I see one more thing that just needs to be fixed. I just hate the fact that I'd be saying

"Hey, hows this look? Oh, ignore that orbit line flickering on and off, thats from loss of float accuracy - oh, and hey, ignore the suns corona vanishing everytime you autoorbit it, just a bug I havent found yet - and ignore that when the orbit lines DO show up the planets are slightly off, yet another floating point error - no, the button there really works, but sometimes you gotta click it a few times to get it going - yah, Sedna is so far out that sometimes the program drops to desktop when you go there ... but other than that things work great!"

On the other hand, I am going to have to release a run sooner or later just too see how viable this is going to work. My father in laws computer ran it at a whopping 2-4 fps (sometimes it topped out at 15 but not often). My wifes made 20 fps, but it had a nasty gfx strip down the middle (voodoo 2 problem?), and my friends computer just rolled over and died and refused to do anything without a reboot.

I run at a strong 75 fps, only losing points when hit a system with a lot of moons on their initial load, but after that things are back to 75. I'm adding in an options screen now to set some graphics levels, then I'll prolly do a release to see how well peoples stuff performs.


-Rick-(Posted 2004) [#14]
I posted a file download in the showcase forum.