working gravity effects. (a download)

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

working gravity effects. (a download)

Post #1by marc » 24.04.2002, 03:14

Ive finished adding gravitational effects to the observer. :D

To activate gravitational effects press F9 if you are near a large body you should start to see your speed change.
Currently the sols mass is hardcoded and thus all stars have this mass.
Solarsys.ssc contains mass entries for the Nine major planets and the Moon (all in kg).

The observers velocity is now linked to the time compression.

Try tracking jupiter then press F9 and increase the time compression a bit.
Its tricky but you can get yourself orbiting.

hopefully it all works, and all the scaling is ok.

// here is the w32 binary, solarsys.ssc and modified source.
// the file celestia_gravity.zip ~500k is at this site
// http://marcgriffith.150m.com
// or try this
// http://marcgriffith.150m.com/celestia_gravity.zip

not any more go here http:://mostlyharmless.sourceforge.net

known problems:
I'm not sure of this one but I think that having Follow mode or Sync orbit set ruins the effect.
Releasing F9 brings the velocity back to the last manually set velocity.
Going through the center of a body can give a huge slingshot effect, totally unrealistic.
Theoritacally it should crash as the accelleration goes infinite.

comments on any errors, or further ideas would be appreciated.

enjoy!
Marc[/quote]
Last edited by marc on 15.05.2002, 04:55, edited 2 times in total.

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

an orbit question

Post #2by marc » 24.04.2002, 04:36

Image

can anyone figure out the *.ssc entry for this type of orbit?

is this possible? or would the spacestation be continually thrusting?

[/img]

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Whoops, If your planets are naked.

Post #3by marc » 24.04.2002, 05:44

Copy all these
celestia/textures/*.* to here celestia/textures/medres/*.*

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #4by chris » 24.04.2002, 15:01

You can use the new PrecessionRate feature in the latest Celestia 1.2.4 prerelease to do this. Assuming that the 'axis' of the wheel is the y axis, put these lines in solarsys.ssc:

Obliquity 90
RotationPeriod 0.1
PrecessionRate R

Where R is calculated as the 360 divided by the orbital period in days. For a geosynchronous orbit, R is just 360.

The Obliquity 90 orients that rotation axis of the wheel to be at a right angle to the precession axis. Hopefully, it will also point the rotation axis of the model at Earth (if not, you may be able to use RotationOffset to adjust it.) One thing that Celestia is currently missing in the .ssc format is an orientation parameter that lets you set the orientation of a model without modifying the rotation axis.

--Chris

Fleegle
Posts: 25
Joined: 10.04.2002
With us: 22 years 6 months
Location: Canada
Contact:

gravity problems

Post #5by Fleegle » 24.04.2002, 18:36

Hey Marc, the gravity effects don't seem to be working for me. The observer will begin to fall towards the planet but at a certain point the observer starts moving away from the planet and keeps going. I haven't gone anywhere near the center of the body but I'm wondering if this might be a partial slingshot effect. The observer is at a speed of 0 and no orbital or tracking modes are on.

Anyways, just curious how to get this working.

Regards,
Fleegle

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

A guide to getting into orbit.

Post #6by marc » 24.04.2002, 23:49

thanks Chris. wait out for the planet lave and its orbiting coriolis space station.

A guide to getting into Orbit

This is based on the celestia 1.4 code from the sourceforge repositry. But should work with earlier versions. (though havnt tested it)

make sure you replace you solarsys.ssc file with the one I provided.
There is also a readme.txt in the zip which should help.

Start celestia and once your at Io press F9
this will turn the effects on.
up the top of the screen there should be something like this

Gravitational effects (F9): 1
accel : 0.6986217005
Body count 105.0000000000000

If you can't see the above then ive posted the wrong binary.

the 1 just means that gravity is on.
accel is in meters per second squared. ms^-2
Bodycount should match the number of objects in that system.

your speed should be changing too.
if they all remain at zero then you dont have the mass info in your solarsys.ssc file.

Try putting the mass entries into your existing file. (in kilograms)
But dont put in masses for asteriods as it will crash.
for example:

"Mercury" "Sol"
{
Texture "mercury.jpg"
BumpMap "mercurybump.jpg"
BumpHeight 2.5

Mass 3.18e23
Radius 2440

CustomOrbit "mercury"
EllipticalOrbit {
Period 0.2408
SemiMajorAxis 0.3871
Eccentricity 0.2056
Inclination 7.0049
AscendingNode 48.33167
LongOfPericenter 77.456
MeanLongitude 252.251
}

RotationPeriod 1047.509
Obliquity 7.01
LongOfRotationAxis 228.31

Albedo 0.06
}


masses for the some major bodies. (from my 1996 serway physics book)
Mercury 3.18e23
Venus 4.88e24
Earth 5.98e24
Marc 6.42e23
Jupiter 1.90e27
Saturn 5.68e26
Uranus 8.68e25
Neptune 1.03e26
Pluto 1.4e22

if you want to simulate a black hole you can go high as 1.0e38

Orbiting Jupiter.

to get into an orbit you first need to match your speed an position with a minor body. Start with io. Make sure Follow and Sync orbit is off (press esc) Using the A and Z keys and the keypad maneuver yourself so you are chasing Io at its orbital speed (about 26kms^-1). Its easiest to do it at 10x faster and let io go past you first.
Once you think have Io's speed matched and it is in the center of your view turn on the gravity. (F9)

Image

Now hold the left mouse button down and turn with the mouse to face jupiter. (dont use the keypad) Click on jupiter once, and once only to select it. (if you click twice celestia will travel to jupiter and you will have to start again).
Then press T to track it. Increase the time compression with L and you should be in some sort of orbit around Jupiter.

Image

Please let me know how you go, Marc.

hyperbolics

more on the gravity thing please!

Post #7by hyperbolics » 05.05.2002, 22:18

this is pretty cool, but most of my 'orbits' are once-thru' slingshots. It would be a lot easier to control if we could operate the thrusters independently to drop into lower faster orbits or higher slower ones, while gravity is activated. Plus of course, if solid planets are added in for us to land on (or bounce off!) it 'll be a huge improvement.

hyperbolics

gravity

Post #8by hyperbolics » 05.05.2002, 22:23

i nearly forgot to ask- does it only work in systems with planets? When i go to a star without any there are no gravity effects, the body count being one ( which i assume is me ) Don't the stars have any mass written in?

marcg

gravity

Post #9by marcg » 06.05.2002, 05:01

hyperbolics wrote:i nearly forgot to ask- does it only work in systems with planets? When i go to a star without any there are no gravity effects, the body count being one ( which i assume is me ) Don't the stars have any mass written in?

There is function to retrieve a stars mass as yet...
I have hardcoded the sol's mass for our solarsystem and thus every other star has this mass as well.
Once I have a method to get each stars mass I will apply the gravity effects to single stars.
Id like to be able to extract the masses from the database but I may have to estimate it given the stars radius and stellar class.
(know of any good tables?);
Thrusters are coming so wait out.
Marc

marcg

gravity

Post #10by marcg » 15.05.2002, 02:53

marcg wrote:Thrusters are coming so wait out.
Marc



Please give us those thrusters. We need continuous acceleration for creating new orbits around planets and moons. Can the thrusters be controlled by the throttle lever on standard joysticks? That would be way cool!

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

thrusters

Post #11by marc » 15.05.2002, 04:27

is there another marc griffith (marcg) out there? Please dont confuse me I may develop an identity crisis.

On the subject of thrusters, well ive been mucking about with other stuff and exams are up for me soon: must do my homework, they may take a while yet. Slaved to the joystick is a good idea, but will be focussing initially on the keyboard.

I have refined the gravity effects, Every star class now has its own mass. The main sequence stars should be pretty accurate, the other sequences are fudged a bit more severly. (im open for corrections) Ive also added masses for many of the larger moons in the sol system into the solarsys.ssc file.

Also, once you go below the surface of a planet the gravity will decrease linearly to zero at the center (as it should).

Other changes include :
Twinkling stars (just imagine your spaceship has the windscreen demister on)
Preloading of entire solarsystem textures.

these changes are all in the mostlyharmless cvs tree. I havnt got around to uploading another release yet (Australia is still in the modem era). Again wait out.

Peter3210
Posts: 5
Joined: 15.05.2002
With us: 22 years 5 months
Location: Arlington, VA

thrusters

Post #12by Peter3210 » 15.05.2002, 11:26

marc wrote:is there another marc griffith (marcg) out there? Please dont confuse me I may develop an identity crisis.

On the subject of thrusters, well ive been mucking about with other stuff and exams are up for me soon: must do my homework, they may take a while yet. Slaved to the joystick is a good idea, but will be focussing initially on the keyboard.



Sorry marc, I came here last night for the first time and the forum software didn't show my name correctly when I posted my message. It should be Peter3210.

In connection with the thrusters would it be possible to show the numerical attitude of the spacecraft relative to the planet that it is orbiting? That is critical to establishing an orbit since the longitudinal axis of the spacecraft must be tangential to the planet in order to accelerate to the proper velocity for achieving orbit.

Thanks
Peter

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

orbits

Post #13by marc » 16.05.2002, 04:54

No worries on the name.
So you want the angle between the (spaceship to planet) and (spaceship orientation)
would the angle between the (spaceship to planet) and (spaceship velocity) be useful as well?
I should be able to do both. I may also be able to calculate the required orbital velocity on the fly. I wonder if it can be done for elliptical orbits as well..
It may take a while as ive got a lot of uni stuff on at the moment, but it will happen eventually
marc.

Peter3210
Posts: 5
Joined: 15.05.2002
With us: 22 years 5 months
Location: Arlington, VA

orbits

Post #14by Peter3210 » 16.05.2002, 11:57

marc wrote:No worries on the name.
So you want the angle between the (spaceship to planet) and (spaceship orientation)
would the angle between the (spaceship to planet) and (spaceship velocity) be useful as well?
I should be able to do both. I may also be able to calculate the required orbital velocity on the fly. I wonder if it can be done for elliptical orbits as well..
It may take a while as ive got a lot of uni stuff on at the moment, but it will happen eventually
marc.


Yes I believe that the former is part of the position vector while the latter is a part of the velocity vector. Both would be useful in spacecraft navigation. Bringing these features to Celestia would go a long way toward making it not only a wonderful viewing tool tool but an educational flying experience as well.

Guest

Post #15by Guest » 16.05.2002, 14:51

I haven't (yet) tried the gravity download, but I was wondering if it could apply to other objects besides the observer. Obviously it would be kind of stupid to apply gravitational effects to every body in the solar system, but what about selected objects such as probes ? I am thinking that perhaps this could be used to simulate the orbits of the Voyagers and Pioneers rather than writing lots of code, or just sticking them around a single planet.... did they apply acceleration after they left Earth, or did they just shoot off on a pre-planned but uncontrolled trajectory ? If they DID accelerate after leaving Earth, anyway of writing this into a .ssc file or something ? Just thinking on the keyboard here so I don't know if I'm making much sense.

(Mad Boris)

Peter3210
Posts: 5
Joined: 15.05.2002
With us: 22 years 5 months
Location: Arlington, VA

Post #16by Peter3210 » 16.05.2002, 23:49

The only acceleration applied to the Voyager and Pioneer spacecraft were very small and very infrequent mid-course corrections. Planetary spacecraft use the gravity fields of planets to accelerate relative to the Sun as they flyby enroute to their ultimate destination.

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

Post #17by marc » 20.05.2002, 07:44

Anonymous wrote: I was wondering if it could apply to other objects besides the observer.
(Mad Boris)


The long term plan is to have a spaceship type object which is subject to gravity effects and has its own thrusters and ai. Many of these objects could be created just like the planets.
A little script to control the spacecraft could be a possibility.

If we set celestia to Voyagers launch date (1977) are all the planets in the correct position?

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 7 months
Location: Outback Australia

thrusters

Post #18by marc » 20.05.2002, 16:54

marc wrote:
I have refined the gravity effects, Every star class now has its own mass. The main sequence stars should be pretty accurate, the other sequences are fudged a bit more severly. (im open for corrections) Ive also added masses for many of the larger moons in the sol system into the solarsys.ssc file.

Also, once you go below the surface of a planet the gravity will decrease linearly to zero at the center (as it should).

Other changes include :
Twinkling stars (just imagine your spaceship has the windscreen demister on)
Preloading of entire solarsystem textures.


There is now a file release of this patch at http://sourceforge.net/project/showfile ... p_id=52323

there are also some fractal generated planets in there planets run the mostlyharmless.cel script to have a look.

Sir Homer

Post #19by Sir Homer » 21.05.2002, 00:18

I like this idea, it's almost like a celestial flight simulator! Watch out Star Wars. :)

Vicware
Posts: 120
Joined: 23.02.2002
With us: 22 years 8 months
Location: Los Angeles, CA

Post #20by Vicware » 21.05.2002, 02:02

What the hec is a .rar file?


Return to “Development”