More Planet/Star Information

The place to discuss creating, porting and modifying Celestia's source code.
symaski62
Posts: 609
Joined: 01.05.2004
Age: 41
With us: 20 years 4 months
Location: france, divion

Post #21by symaski62 » 20.10.2004, 22:56

DSF wrote:Ken,

If this may help you, I have implemented a little bit more information on the screen tampering with Celestia code, but it was not forthright.

The code I entered, mainly, allows me to see the Body mass, Gravity, Orbital Radius and Density, though more information is easily inserted if you put this into it.

First, I created a nw entry in the ssc files for bodies listing their Mass whigh goes like this:

Mass 5.98E+24

That's earth's mass.
Then, to make Celestia read this information, I added a new private property to the Body class in "body.h":

double mass;

and the following new methods:

double getMass() const;
void setMass(double);
float getDensity() const;
float getGravity() const;

which were defined in "body.cpp" like this:

double Body::getMass() const
{
return mass;
}


void Body::setMass(double _mass)
{
mass = _mass;
}

float Body::getGravity() const
{
return GRAVITATIONAL_CONSTANT * mass / pow(radius*1000, 2);
}

float Body::getDensity() const
{
return mass*1000 / (4 * PI * pow(radius*100000, 3) / 3);
}


Thus, the "CreatePlanet" function in "Solarsys.cpp" had to be altered to actually make Celestia read the information in the ssc files. This was easily done with the following lines:

double mass = 0.0;
planetData->getNumber("Mass", mass);
body->setMass(mass);

inserted at about line 377 of solarsys.cpp (right after the code loads the oblateness data).

Lastly, I modified "celestiacore.cpp" to allow it to display the new extra information, altering the "displayPlanetInfo" method by adding:

if (detail > 2)
{
overlay << "Period: " << body.getOrbit()->getPeriod() << " Earth days\n";
if (body.getMass() > 0)
{
overlay.printf("Mass: %.2E Kg\n", body.getMass());
overlay.printf("Gravity: %.2f m/s2\n", body.getGravity());
overlay.printf("Orbital Radius: %.2E km\n", body.getOrbit()->getBoundingRadius());
overlay.printf("Density: %.2f g/cm3\n", body.getDensity());
}
}

You may notice that the condition "if (detail > 2)" refers to a detail lever which will never be properly selected in Celestia, since its detail levels are 0, 1 or 2. I added a new detail level in the render options menu called "astro" with code 3 that allows for the selection of this new information.

The result:

Image



Image
:oops: OUPS NEW !! ouai!! I makes!!

pffff moi windows XP

Code: Select all

celestia\
celestia\data
celestia\extras
celestia\fonts
celestia\models
celestia\shaders
celestia\textures


:?: fichier.cpp , fichier.h etc .. :?: never see :?:

http://cvs.sourceforge.net/viewcvs.py/c ... ortby=date

CVS ??

bye tomorrow...
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #22by Evil Dr Ganymede » 20.10.2004, 23:09

Symaski62 - could you please add more explanatory text to your messages? Even if it's all in French? Currently we're just left guessing at what you could be saying (I have absolutely no idea what you're trying to say or tell us in the previous post).

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

Post #23by t00fri » 20.10.2004, 23:35

Evil Dr Ganymede wrote:Symaski62 - could you please add more explanatory text to your messages? Even if it's all in French? Currently we're just left guessing at what you could be saying (I have absolutely no idea what you're trying to say or tell us in the previous post).

To me it was crystal clear:
Symaski62 wrote:pffff moi windows XP


Bye Fridger

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #24by Evil Dr Ganymede » 21.10.2004, 00:19

t00fri wrote:To me it was crystal clear:
Symaski62 wrote:pffff moi windows XP

Bye Fridger


And? Why did he quote the rest of the post? Why did he put a thumbnail of Earth? What the heck does "OUPS NEW !! ouai!! I makes!!" mean? What does Windows XP have to do with it? Why did he print a list of his folders and quote filenames?

I sure don't mind if he writes more detail in french, at least people who can read that would be able to make more sense out of what he tries to say that trying to figure out what he means depending on the odd exclamation and what smileys he uses...

Evil Dr. Europa

Post #25by Evil Dr. Europa » 21.10.2004, 06:05

Evil Dr Ganymede wrote:
kikinho wrote:Ah, and one more thing. Why did you choose the name Ganymede, Evil dr. Ganymede? It can be for some reason.

I did part of my PhD on it :), and I always figured it was under-rated as Galilean satellites went. I mean, it's the biggest satellite in the solar system, and what gets the attention? That little upstart Europa! 8) :lol:


Upstart! Well excuse me! :evil:

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #26by Evil Dr Ganymede » 21.10.2004, 07:15

Evil Dr. Europa wrote:Upstart! Well excuse me! :evil:


dammit, where's a "sticking out tongue" smiley when you need one! :mrgreen:

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 21 years 10 months

Post #27by granthutchison » 21.10.2004, 08:49

Evil Dr Ganymede wrote:And? Why did he quote the rest of the post? Why did he put a thumbnail of Earth? What the heck does "OUPS NEW !! ouai!! I makes!!" mean? What does Windows XP have to do with it? Why did he print a list of his folders and quote filenames?
It seems Symaski62 likes the new planet information (as displayed in the image he quotes into his own post), is excited about it, and wants to add it to his own Celestia installation:
OUPS NEW !! ouai!! I makes!!
But then he's disappointed that he can't see where in his Windows XP installation (the directory list) the code fragment would fit:
pffff moi windows XP ...
He says he's never seen the relevant file extensions:
fichier.cpp , fichier.h etc .. never see
He wonders where they are in the CVS:


Surely that's easy enough to follow? :)

Unfortunately he seems to speak French about as well as he speaks English (I don't know why he says he's French).

Grant

Evil Dr. Callisto

Post #28by Evil Dr. Callisto » 21.10.2004, 09:55

Evil Dr Ganymede wrote:
Evil Dr. Europa wrote:Upstart! Well excuse me! :evil:

dammit, where's a "sticking out tongue" smiley when you need one! :mrgreen:


There is a "sticking out tongue" smiley when you need one :P , and you say Ganymede doesn't get the attention it deserves, what about Callisto? :wink:

maxim
Posts: 1036
Joined: 13.11.2003
With us: 20 years 10 months
Location: N?rnberg, Germany

Post #29by maxim » 21.10.2004, 15:14

If you need more smileys, just borrow some of mine:

Image Image Image Image Image Image Image Image Image Image Image

maxim

kikinho
Posts: 330
Joined: 18.09.2004
With us: 20 years
Location: Eden, a planet in Etheral Universe

Post #30by kikinho » 21.10.2004, 15:42

Is there any Evil dr. Io, Titan, Triton, or any other name of planet, moon or star?
One day we will swim in the subsurface ocean of Europa and take shower in ethane lakes of Titan.

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #31by Evil Dr Ganymede » 21.10.2004, 16:24

kikinho wrote:Is there any Evil dr. Io, Titan, Triton, or any other name of planet, moon or star?


I'm sure Fridger will make one up ;)

As for Callisto, that's what I'm writing my current paper on :)

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

Post #32by t00fri » 21.10.2004, 18:07

Evil Dr Ganymede wrote:
kikinho wrote:Is there any Evil dr. Io, Titan, Triton, or any other name of planet, moon or star?

I'm sure Fridger will make one up ;)

As for Callisto, that's what I'm writing my current paper on :)


Now what I am curious about is this:

-- OK I understand the origin of Dr. Ganymede, related to Ganymede and your PhD.
-- But where does this other attribute to your user name come from??

-- would you perhaps be interested in selling it to me ;-)
How about a change like: t00fri --> Prof. Dr. Evil?

Bye Fridger

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #33by Evil Dr Ganymede » 21.10.2004, 18:36

t00fri wrote:-- OK I understand the origin of Dr. Ganymede, related to Ganymede and your PhD.
-- But where does this other attribute to your user name come from??


The whole thing is a nickname a friend of mine came up with. It just sounded like a cool mad scientist name, and I liked it :).

Michael Kilderry
Posts: 499
Joined: 11.10.2004
With us: 19 years 11 months
Location: London, UK

Post #34by Michael Kilderry » 22.10.2004, 06:19

Evil Dr Ganymede wrote:
kikinho wrote:Is there any Evil dr. Io, Titan, Triton, or any other name of planet, moon or star?

I'm sure Fridger will make one up ;)

As for Callisto, that's what I'm writing my current paper on :)


Don't blame Fridger for making up Evil Dr. Europa and Callisto, I was doing it all along. It serves you right for calling Europa a little upstart. I bet Ganymede doesn't have possible oceans under it's surface?

Evil Dr. Io, I mean, Michael Kilderry :)
My shatters.net posting milestones:

First post - 11th October 2004
100th post - 11th November 2004
200th post - 23rd January 2005
300th post - 21st February 2005
400th post - 23rd July 2005

First addon: The Lera Solar System

- Michael

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #35by Evil Dr Ganymede » 22.10.2004, 07:09

Michael Kilderry wrote:Don't blame Fridger for making up Evil Dr. Europa and Callisto, I was doing it all along.

Huh. I figured it was him since he's the one always trying to get under my skin ;). Sorry, Fridger.

It serves you right for calling Europa a little upstart. I bet Ganymede doesn't have possible oceans under it's surface?


It does. And they're probably much deeper than Europa's too. So nyah :P

Evil Dr. Europa

Post #36by Evil Dr. Europa » 22.10.2004, 08:54

Oh, You really think so Evil Dr Ganymede, well then, how come everyone is more interested in me? Get use to it, Ganymede's just a ball of rock and ice (and maybe just a little liquid water), so nyah :P . If Ganymede was more popular for having possible alien life, I think it would be terrible for Europa. After all, it is always getting upstaged by that little upstart Mars! (Well, it's bigger than Europa, but it's still little.)

Evil Dr. Mars

Post #37by Evil Dr. Mars » 22.10.2004, 08:58

Upstart! Well excuse me :evil: .

Evil dr. Barsoom

Post #38by Evil dr. Barsoom » 22.10.2004, 11:22

Evil Dr. Europa wrote:it is always getting upstaged by that little upstart Mars! (Well, it's bigger than Europa, but it's still little.)


Mars is not an upstart!

-Evil dr. Barsoom

Evil Dr. Mars

Post #39by Evil Dr. Mars » 22.10.2004, 11:51

Evil dr. Barsoom wrote:
Evil Dr. Europa wrote:it is always getting upstaged by that little upstart Mars! (Well, it's bigger than Europa, but it's still little.)

Mars is not an upstart!

-Evil dr. Barsoom


I couldn't agree more! Mars is not an upstart!

Evil Dr Ganymede
Posts: 1386
Joined: 06.06.2003
With us: 21 years 3 months

Post #40by Evil Dr Ganymede » 22.10.2004, 16:45

You know, this is a Development forum, not Purgatory. It would be nice if we got back on topic.


Return to “Development”