LongLat and Orientation, how do they works, $#@%&*! ?

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

LongLat and Orientation, how do they works, $#@%&*! ?

Post #1by Cham » 14.07.2005, 19:12

Let say I want to place a plane tangent to some fictious planet P. The plane is defined as a 3ds model and is oriented horizontaly in the 3D modeler. So in the ssc file, I define the position of the plane on the planet using the LongLat command :

LongLat [A B C]

where A, B and C are respectively the Longitude, Latitude and Altitude coordinates (am I correct, please?). But WHAT UNITS ARE THEY USING !?

And then, the plane isn't oriented properly on the planet. It isn't tangent to the surface. So I have to use the Orientation command :

Orientation [D E F G]

where D is an angle (in degrees), and E, F, G are the three components of some UNIT vector which defines the orientation axis. We must have this equation satisfied :

Code: Select all

 E^2 + F^2 + G^2 == 1


But then, HOW DO I CALCULATE THOSE $#@%&* FOUR NUMBERS D E F G ?

I want the exact mathematical formula !

P-p-p-p-please help somebody ! :oops:
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #2by Cham » 14.07.2005, 19:41

To be more specific, consider the two pictures below. What I understand, is this. The longitude angle is the angle Phi depicted, while the Latitude is 90 degrees minus the angle Theta below. The Altitude C isn't relevent here.

Image

If I'm right, the unit vector that I need ( E, F, G ) is the vector "n" depicted on the pictures. Its components E, F, G should be the ones on the picture. Right ?

Image

The angle Alpha should be indentical to D, but it isn't relevent either.

Then, the components are easy to calculate using the trigonometric functions. BUT IT DOESN'T WORKS !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Post #3by selden » 14.07.2005, 20:58

Have you looked at Grant Hutchison's explanation for how to place a body on a planet's surface? It's at http://www.lepp.cornell.edu/~seb/celestia/hutchison/defined_locations-130.html
Selden

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #4by Cham » 14.07.2005, 21:03

Selden,

It doesn't explain the LongLat and Orientation commands.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #5by Cham » 14.07.2005, 21:56

How do you create the align.log file on a Macintosh ?

Maybe the "Edit mode" could be usefull. I can activate the Edit mode easily, but I'm unable to trigger the align.log. Shift-1 doesn't work.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #6by ElChristou » 14.07.2005, 22:57

I had the same problem with the stack... an align.log file is created inside the Celestia package, but the file is completly clear...
Image

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #7by jestr » 14.07.2005, 23:01

Cham I have found the following equations work fine with most models.

LongLat [ a, b, c ]
Orientation [ b,1,0,0 ]
RotationOffset a+planet or moon's RotationOffset-90


where a=longitude
b=latitude
c=height
the units are degrees for Latitude and Longitude and km for altitude.
This works if you are looking orthogonally down on the base of the model (landscape) in the Top viewport of your modelling program.Hope this helps Jestr

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #8by Cham » 14.07.2005, 23:17

jestr wrote:Cham I have found the following equations work fine with most models.

LongLat [ a, b, c ]
Orientation [ b,1,0,0 ]
RotationOffset a+planet or moon's RotationOffset-90


where a=longitude
b=latitude
c=height
the units are degrees for Latitude and Longitude and km for altitude.
This works if you are looking orthogonally down on the base of the model (landscape) in the Top viewport of your modelling program.Hope this helps Jestr


Jestr,

you are my hero ! It works like a charm !

Guys, let put this formula inside some golden box somewhere on the forum. It's very important ! :-)
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #9by Cham » 14.07.2005, 23:24

Here it is, Jestr's formula :

Image

:D
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #10by jestr » 14.07.2005, 23:42

Thanks mate,I guess if you have a big landscape though you might need to curve it to fit with the surface of a planet,and the formulae may need some tweaking for worlds such as Venus (retrograde rotators).Jestr

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #11by Cham » 14.07.2005, 23:53

I think that we should all start to add nice landscapes to our Celestia worlds. Here's a timid start :

Image
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Post #12by rthorvald » 14.07.2005, 23:59

jestr wrote:Cham I have found the following equations work fine with most models.
LongLat [ a, b, c ]
Orientation [ b,1,0,0 ]
RotationOffset a+planet or moon's RotationOffset-90


This is very, very cool! Thanks!! :-)

-rthorvald

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #13by jestr » 15.07.2005, 00:12

It would be nice to also have the ability to set RotationPeriod (around an axis,at 90 degrees to the surface?) for these objects so you might have a cloud of an erupting volcano rotating to give the appearance of a cloud ascending,or the giant red spot of Jupiter revolving,,and to be able to have other objects (spaceships?) orbiting around them,Jestr
Last edited by jestr on 15.07.2005, 00:21, edited 1 time in total.

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #14by Cham » 15.07.2005, 00:19

jestr wrote:It would be nice to also have the ability to set RotationPeriod for these objects so you might have a cloud of an erupting volcano rotating to give the appearance of a cloud ascending,or the giant red spot of Jupiter revolving,,and to be able to have other objects (spaceships?) orbiting around them,Jestr


In principle, this is possible with some ssc definitions. The real problem is the depth sorting problem in Celestia. I already tried some months ago to make an erupting volcano. The moving smoke and flames were looking weird near their crater. Sometimes, the crater was looking in front of the flames, and if you rotate around, the reverse may happen ! :-(

This is a project I abandoned. :-(
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #15by jestr » 15.07.2005, 00:23

Cham I think this is a transparency bug not a depth sorting problem-I assume you were using a semi transparent texture for the clouds?DDS (DXT3) seems to have a strange semi-transparent effect with mountains (in particular),Jestr

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #16by Cham » 15.07.2005, 00:34

Transparency bug? I don't think I've experienced that one.

Yes, I was using several semi-transparent textures. Some were used for the rotating cone of smoke, and some were used as flowing lava. The problem occured when some parts was supposed to be on the foreground and the volcano on the background (behind), but Celestia was showing the reverse. Exactly the same problem we experiencd with our nebulae experimentation (remember, Jestr ?).
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #17by jestr » 15.07.2005, 00:38

As far as I have noticed the depth sorting problem is just with DSC objects though not with those defined with SSC's.Jestr

EDIT:try making the textures opaque with NO alpha channel (as an experiment) or perhaps try making the objects semi-transparent in your modelling software


Return to “Celestia Users”