Calculate rotation

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Calculate rotation

Post #1by Rassilon » 20.08.2004, 16:44

I need a formula that can calculate the rotation speed of an alternate object that will sync up with the speed of the clouds.

eg I have a planet with a radius of 1000km and a cloudspeed of 100 kmph and height of 10km and the first object has a rotation period of 10 hours now I overlay another object around the planet that I want to rotate at the same exact speed as the clouds. The radius of object two will be 1010 to match the height of the clouds. Now an object traveling 100 km per hour would circle a 1000 km planet in 10 hours. Ive been plugging away at this for a few hours and have gotten close:

"Pratiis" "Mythica/Monto Derthi"
{
Texture "cratered.jpg"
Radius 1000
Color [ 0.8 0.8 0.8 ]
BlendTexture true
Atmosphere {
Height 100
Lower [ 0.70 0.40 0.21 ]
Upper [ 0.70 0.40 0.21 ]
Sky [ 0.52 0.70 0.40 ]
Sunset [ 0.8 0.20 0.10 ]
CloudHeight 10
CloudSpeed 100
CloudMap "clouds.png"
}
EllipticalOrbit {
Period 12.665
SemiMajorAxis 10400
Eccentricity 0.0010
Inclination 1.5000
MeanAnomaly 90
}
RotationPeriod 10
Obliquity 10.5
Albedo 0.2
}

Add "Pratiis" "Mythica/Monto Derthi"
{
Mesh "clouds.3ds"
Radius 1010
EllipticalOrbit {
Period 12.665
SemiMajorAxis 10400
Eccentricity 0.0010
Inclination 1.5000
MeanAnomaly 90
}
RotationPeriod -8.965
RotationOffset -90
Obliquity 190.5
Albedo 0.2
}

But the clouds still either move faster or slower...I could see this taking hours each time I wished to do this so there HAS to be an easier method. All I need is a formula that would give me the correct rotation period of the second object in order for it to sync up perfectly with the clouds...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #2by Rassilon » 20.08.2004, 18:15

Well I am lead to believe that cloud speed is actually not km per hour...I have used the following calculations to find the correct rotation period...

diameter / ((diameter / planet rotation in hours) + cloud speed)
or
circumference / ((circumference / planet rotation in hours) + cloud speed)

I believe those should work but they do not. What I need to know is what IS cloudspeed...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #3by granthutchison » 20.08.2004, 18:31

CloudSpeed is in degrees per day. 24*360/CloudSpeed should give you a corresponding RotationPeriod in hours.

Grant

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #4by Rassilon » 20.08.2004, 18:56

Thanks grant but unfortunately this will not work due to Celestias use of floats instead of double precision...I will never be able to get close enough to the exact speed with a floating point number...Oh well I thought I was onto moving cloud shadows :(

You can view them in the present day with an adjusted rotation offset but once you get 1000 or more years in the future the clouds are seen to offset...Thier movement is very slow because of the closeness of the value...but not close enough...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #5by selden » 20.08.2004, 19:25

Ras',

To keep them in sync, you'll have to define both the clouds and their shadows as additional objects. Then you don't have to try to match the exact cloud speeds that Celestia calculates. You also can define multiple layers of clouds this way.
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #6by Rassilon » 20.08.2004, 20:11

Yeah I might do this...Problem with that is clouds do not properly light up on the underside like they do when rendered by Celestia. eg: On the dayside the clouds appear black in the sky...What I planned to do was render the clouds celestia uses, a model of the same clouds overlaying that and a shadow map near to the surface. The reason for the overlay model of clouds is because the shadowmap of clouds will appear on top of the clouds rendered by celestia...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #7by selden » 20.08.2004, 20:19

Hmmmm. And a partially transparent model probably won't do the right thing, either; and Emissive true would light them up on the dark side of the planet. grump

I guess doing it right would require a way to specify "translucency", so that forward scattering could be emulated.

Heck, Celestia just needs to be upgraded to have a fully general rendering engine! ;)
Selden


Return to “Development”