Page 1 of 1
Coding question: loading the star database.
Posted: 28.02.2006, 03:15
by JoeLinkous
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.
Posted: 28.02.2006, 08:18
by JoeLinkous
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.
Posted: 01.05.2006, 05:52
by scratt
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..
Posted: 01.05.2006, 08:59
by t00fri
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