Coding question: loading the star database.

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
JoeLinkous
Posts: 2
Joined: 28.02.2006
With us: 18 years 6 months

Coding question: loading the star database.

Post #1by JoeLinkous » 28.02.2006, 03:15

Im relatively new to C++ programming, much less DirectX stuff. One thing I really wanna know how to do is load the star database program Celestia uses into my program. There are SOOO many cpp and other files in the Celestia source code that Im barely able to tell whats going on even in the star loading code. All I really need to do is load the stars into variables, then I can work with it from there. I seriously doubt Ill use every single piece of data for each star, so simply being able to processes locations, sizes, brightnesses and colors of even some of them will be PLENTY of work for me.

EDIT: It seems the readstars.cpp has almost everything I need, though I have no idea how to go about working with it.

I also wanna find where the solarsystem database loader is. Since it's in a simpler format than the stars database is, I figure that would be the best place to start, if I could find it.

Topic author
JoeLinkous
Posts: 2
Joined: 28.02.2006
With us: 18 years 6 months

Post #2by JoeLinkous » 28.02.2006, 08:18

It seems like it would be much more simple to load the solarsys file containing all the plantetary information since its already in its own standard format, in addtion to the fact that I can actually see what's in the file to double check load accuracy.

Im having problems figuring out how to load numbers from files into int and float vars.

scratt
Posts: 36
Joined: 05.12.2005
With us: 18 years 9 months
Location: Thailand

Post #3by scratt » 01.05.2006, 05:52

JoeLinkhous, with all due respect I think that perhaps you need to brush up on your C skills a little. It's not really in the scope of this forum to help with programming problems..

Celstia is written in a very clean and modular way, and is quite easy to follow. If you are having problems with the code in individual files you have to ask yourself if your programming skills are up to the task yet.

You can use the process of understanding Celestia as part of your studies, but I would back it up with books such as C++ Primer Plus, and other titles..

This post is meant in the best possible spirit, and as I noticed no one had replied to you for quite some time..
Extreme Sports Cafe - Remember, measure life by the moments that take your breath away, not by how many breaths you take...

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 5 months
Location: Hamburg, Germany

Post #4by t00fri » 01.05.2006, 08:59

I agree completely with scratt.

Another suggestion is to take the human readable stars.txt file as a source of the stars data. Anyone unable to read these in should rather do something else than programming ;-) .

Actually all that is necessary (including the handling of binary stars.dat) one finds in the source tar ball in src/tools/stardb. From the above email I conclude that our friend didn't even take the time to look at the sources carefully before writing that post. A directory called 'stardb' is rather selfexplanatory, isn't it.

Bye Fridger
Image


Return to “Development”