Question regarding gotoloc script command

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Question regarding gotoloc script command

Post #1by don » 19.07.2003, 05:53

Howdy All,

Could someone please explain what the gotoloc script command is used for, what it's parameters represent (time I know, but not position, xrot, yrot, and zrot), and provide a code example of how to use it?

Thank you very much.

-Don

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #2by don » 22.07.2003, 19:05

This should be an easy one for some of you, yes?

Thank you...

-Don

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #3by don » 28.07.2003, 21:18

...
Nobody knows?
...

abiogenesis
Posts: 104
Joined: 07.06.2002
With us: 22 years 5 months
Location: Redmond, WA

Post #4by abiogenesis » 29.07.2003, 00:04

Hey, don-

I'm not talking from Celestia scripting experience, but rather from 3D graphics programming, so take this with a grain of sodium chloride. :wink:

Position will be the 3D vector specifying the cartesian position of the observer. It's just like plotting a point on a 3D graph. X, Y, and Z. I don't know how the axes are aligned in Celestia, but you should be able to figure it out by playing around with it. I'm pretty sure that the Sun is the origin (location= <0,0,0>).

xrot, yrot, and zrot are the "Eular Angle" or "Angle-Axis" representation of the observer's orientation. Think of them as Pitch, Roll, and Yaw in avionics. These are used to control which direction the observer is looking.

Hope that helps.

- a b i o g e n e s i s -

Edited to correct my terminology error. :oops: I should have double-checked my notes...
Last edited by abiogenesis on 29.07.2003, 01:07, edited 1 time in total.

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

Post #5by chris » 29.07.2003, 00:18

xrot , yrot , and zrot are the "eigen vector" or "angle-axis" representation of the observer's orientation. Think of them as Pitch, Roll, and Yaw in avionics. These are used to control which direction the observer is looking.


One quick correction of terminology: yaw, pitch, and roll are Euler angles . . . eigenvectors are something else entirely.

--Chris

abiogenesis
Posts: 104
Joined: 07.06.2002
With us: 22 years 5 months
Location: Redmond, WA

Post #6by abiogenesis » 29.07.2003, 01:00

My bad! :oops: Of course, you're right! I always got those terms confused! Eigen is german for "to own", Euler was the mathematician. I apologize for my brain fart.

Anyway, although my terms may have been wrong, it appears that my understanding of the concept was sound. Eigen vectors are useful in linear algebra as well, but for completely different reasons.

- a b i o g e n e s i s -

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #7by don » 29.07.2003, 01:57

abiogenesis wrote:Position will be the 3D vector specifying the cartesian position of the observer. It's just like plotting a point on a 3D graph. X, Y, and Z. I don't know how the axes are aligned in Celestia, but you should be able to figure it out by playing around with it.
Thank you abiogenesis for taking a crack at this one <smile>!

I have played with this command, on many different days, spending hours at each play session.

So far, the only one of the three values I have determined for "position [x y z]", is z. It represents both, the Altitude (in km) from the core of the selected object (when the value is less than 4 times the radius of the object) -and- the Distance (in km) from the surface of the selected object (when the value is greater than 4 times the radius). Makes it a bit difficult to set a value.

Yes, Celestia displays two different distance values, which I think is a bug. (See http://ennui.shatters.net/forum/viewtopic.php?t=2973.)

The x and y values do different things (some very strange) depending on what coordinate system is being used, and if Track is on or off. So, I've not fully figured these out yet.

With one coordsys setting, the object is moved horizontally and/or vertically on the screen, without moving the stars (camera position is not changing).

With another setting, the object is rotated (camera position changes).

With yet another setting, the screen turns black (no object and no stars).

So, unless someone *knows* what the x and y values are supposed to do for each coordsys/Track combo setting, I have a LOT of experimenting to do <sigh>.


I'm pretty sure that the Sun is the origin (location= <0,0,0>).
Using a position [0 0 0], with Earth selected, results in the following position as reported by Celestia's "Go To Object" dialog box:
* Distance = -6378.0 (dead-center of the Earth)
* Latitude = -1.#IND0 <-- obviously an error code
* Longitude = 180.00000

So, in the gotoloc command, it appears that the currently selected object is the "origin", yes?


xrot, yrot, and zrot are the "Eular Angle" or "Angle-Axis" representation of the observer's orientation. Think of them as Pitch, Roll, and Yaw in avionics. These are used to control which direction the observer is looking.

I haven't gotten this far in my testing yet, so I hope you are right and will reduce the number of hours I'm spending trying to figure out how to use these commands <smile>.

Thanks again abiogenesis!
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #8by don » 29.07.2003, 02:08

Chris, you little sneak you <laughing>!

You read the messages and didn't tell us what this stuff means and how to use it? I'm loosing more hair every day trying to figure out some of these commands and variables <laughing>. It's fun playing with them, for an hour or two at a time, that is. But if I can't figure one out, it starts getting a bit frustrating. That's when I move on to something else.

What abiogenesis said about xrot, yrot and zrot (Pitch, Roll, and Yaw ) sounds logical, and I had assumed this, but had not tested it yet to determine which axis each represents.

But, Chris, please tell me what the x and y values in position [x y z] are for and how the results will vary depending on the coordsys and Track settings -- if you have a few minutes.

Thank you.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

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

Post #9by selden » 29.07.2003, 03:52

Don,

Unfortunately, it takes more than a few minutes to describe how vectors and coordinate systems interact to someone who is not knowledgable about the underlying math. See my rather long discourse about the up vector, for example, which is drastically oversimplified and, I fear, quite cryptic as a result.

My understanding is that Chris simply does not have the free time right now to make more than the occasional brief comment.
Selden

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #10by don » 29.07.2003, 06:00

selden wrote:Unfortunately, it takes more than a few minutes to describe how vectors and coordinate systems interact to someone who is not knowledgable about the underlying math. See my rather long discourse about the up vector, for example, which is drastically oversimplified and, I fear, quite cryptic as a result.
[RANT <sigh>]
I really hate writing this kind of message, especially to someone who appears to be intelligent and educated. But, enough is enough ...

Yes Selden, I read your other reply, before coming here to see abiogenesis's reply to this topic. Your reply ticked me off, which is why I did not reply at the time, because it ONCE AGAIN tells me how stupid I am and that I should go read 10 books.

Your useless reply in THIS topic put me over the edge.

Selden, I know you mean well, but please stop telling me how stupid I am in reply to every message I write asking about x y z values. You know absolutely nothing about me.

So, let me put this to bed right here and right now -- I am not not NOT going to read any school books on Astronomy, Spiral Vectors, 3-D graphics, Celestial Observations, Celestial Cartography, or Celestial Navigation.

Did you get that?

Let me repeat ...

I am NOT going to read any books right now.

So please, get off of your "Mr. Scientific" soap box and get down to the level of "normal" people, who by the way are NOT stupid just because they don't know what you know! Selden, it seems to be you who is the one lacking in this case because you are not able to explain these very simple things (that you think are so extraordinary) to a mere mortal <laughing>. Yes, simple, like positioning your hand in the air, and moving it around, is a very simple thing -- gee, maybe even like positioning and moving a camera around in outer space?

abiogenesis did quite a nice job of explaining xrot, yrot, and zrot in the gotoloc command above, without putting me down, by simply referring to Pitch, Roll and Yaw (which I understand perfectly). I don't know why you would rather put me down (go read 10 books) instead of simply providing what I asked for (explanation and example). I guess that's just you. If you are not able to provide what I asked for, then why are you even replying to my questions? Just to "get to me"?

Give me a break please. I am not going to become what you are (knowledgable in certain things that I am not) just to write the Celestia Scripting Guide.

I am asking you and others to SHARE your knowledge, and not to simply brush me off by telling me I need to go read books. Okay? If you can help me, then please do so. If you can not, then please quit answering my message questions by telling me to go read books.
[/RANT]

My understanding is that Chris simply does not have the free time right now to make more than the occasional brief comment.

Yes, I am aware of this, as Chris wrote in one of his messages. Maybe you didn't see my "<laughing>" in the message I wrote to him?

Selden, I am not here to "compete" with you, or anyone else. Your contributions to the Celestia project are quite visible (your web site, forum postings, and add-on work) -- along with many other members of the Celestia team as well.

I am here ONLY because I love stargazing, I love anything to do with space travel and exploration, and I LOVE Celestia, and would like to contribute what I am able to -- which is software testing and writing a Scripting Guide, okay? Or do you think there is something wrong with my doing these things because I don't have the knowledge you do?

In order to write the Scripting Guide, I will need assistance with some of the commands and variables from those who know or have experience using them -- just as I explained in my initial posts.

I simply cannot fathom that Chris and the development team went through all the trouble of designing and coding the .cel Scripting commands, which were probably a requested feature, and then nobody ever used them. So, aside from Chris and the other developers, there must be someone out here who uses .cel scripting in Celestia, or can provide explanations and examples to my (vector in particular) questions, no?
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #11by Christophe » 29.07.2003, 10:35

Don,

Can you post here the result of your work on the .cel documentation? I don't use scripts but reading the code I can probably help you fill in the blanks, simply give me the list of the commands/arguments you're not sure about.

Also don't spend too much time documenting the .cel scripting language as it won't evolve anymore.

The .celx language is incomplete but with documentation people will hopefuly start using it and ask for new commands. That will motivate the development team to work on it some more.
Christophe

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

Post #12by chris » 29.07.2003, 18:36

The gotoloc command in its current state isn't something I'm terribly proud of :oops: But, I suppose it's still worth explaining because the concepts will be relevant for scripting Celestia with Lua as well . . .

Each of Celestia's modes--follow, sync orbit, lock, chase, and free--together with one or two objects defines a coordinate system. All these coordinate systems are orthonormal, meaning that the x, y, and z axes are all at right angles to each other and all have unit length. To put it another way, there's no stretching.

The position argument in gotoloc is a point in the current coordinate system specified in units of kilometers. The origin of all coordinate systems except free is the center of the reference object. So, if you are following Mercury and execute a gotoloc command with a position of [ 0 0 0 ], you'll travel to the center of Mercury. In free mode, [ 0 0 0 ] happens to be a location near the Sun . . . However, the only thing that you really need to know about positioning in free mode (I call it the universal coordinate system) is that it's not time dependent--a given position will always put you at the same point in space regardless of the current simulation time.

In addition to the origin, you also need to know the directions in which the x, y, and z axes point. In follow mode, the x axis points away from the Sun in the direction of the J2000.0 vernal equinox, the y axis is normal to the ecliptic with positive y north, and the z axis completes the right-handed coordinate system.

In sync orbit mode, the axes rotate with the reference object. The y-axis is the axis of rotation (counterclockwise, so it points north for prograde rotators like Earth and south for retrograde rotators like Venus.) The x axis points from the center of the object to the intersection of its zero longitude meridian and equator. And the z axis completes the right-handed coordinate system.

The definition of the lock coordinate system involves a second object which I call the target. The z axis points from the reference to the target; the y axis lies in the plane defined by the z axis and the rotation axis of the reference object, at a right angle to the z axis. The x axis completes the right-handed coordinate system. This definition unfortunately does not work when rotation axis perfectly aligned with the reference to target direction. It also produces strange results with precessing objects--in fact, I'll probably change it so that the coordinate system is defined by the axis of precession instead of the axis of rotation.

Chase is defined similarly to lock, except that the z axis points in the direction of motion relative to the target object's parent body (the Sun for planets, a planet for moons.)

Does this clear things up at all?

--Chris

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #13by don » 29.07.2003, 18:50

Christophe wrote:Don,

Can you post here the result of your work on the .cel documentation? I don't use scripts but reading the code I can probably help you fill in the blanks, simply give me the list of the commands/arguments you're not sure about.
Hi Christophe,

Thank you for your offer. The guide is currently incomplete and is a 56 KB text document, so I would not want to post it in a public forum right now. However, I will PM you with a link to it on my web site so you can download it for review and question answering. Thank you!

Christophe wrote:Also don't spend too much time documenting the .cel scripting language as it won't evolve anymore.
I understand this, however not all folks will be able to learn how to use Lua and since .cel is pretty simple, I thought spending time on it would be worthwhile for all "beginners" / non-programmers who find Celestia.

Christophe wrote:The .celx language is incomplete but with documentation people will hopefuly start using it and ask for new commands. That will motivate the development team to work on it some more.

I thought .cel would be a good place to start myself out to learn more about the "guts" of Celestia. Then, hopefully, I could make the transition to Lua and .celx once I understand a lot of the terminology used in Celestia programming. Make sense?

Thanks again!
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #14by don » 29.07.2003, 19:01

chris wrote:... But, I suppose it's still worth explaining because the concepts will be relevant for scripting Celestia with Lua as well . . .

Thank you Chris. Yes, I wanted to start out with .cel because of it's simplicity, in order to understand the terminology and functions used in Celestia -- before getting into Lua/.celx.

I appreciate you taking time out of your hectic schedule this week to write this message. It was unexpected from you but very much appreciated <smile>. If you happen to come across a message from me that you can actually explain, but do not have the time right then, please simply reply something like "remind me next week and I can help.", okay? I don't want to "demand" any of your time, especially when you have a tight schedule.

This is exactly what I needed !

I understand all of the words and phrases you used, and I'm sure anyone who knows about these things will have no problems picturing them all in their mind when they read it in the guide. I, on the other hand, need to read it several times in order to create that picture -- which is NOT a problem, just a personal challenge due to my currently limited knowledge. But, like I said, I understand the words and phrases and thus will be able to place your definitions into the scripting guide.

Once I actually start experimenting with it myself, in order to create example scripts for the guide, I may have additional questions <smile>.

Thanks again Chris.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

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

Post #15by chris » 29.07.2003, 19:09

What's really needed to clarify Celestia's various coordinate systems is a set of diagrams . . . I need to find the time black market and buy myself two months.

--Chris

abiogenesis
Posts: 104
Joined: 07.06.2002
With us: 22 years 5 months
Location: Redmond, WA

Post #16by abiogenesis » 29.07.2003, 19:54

chris wrote:What's really needed to clarify Celestia's various coordinate systems is a set of diagrams . . .


Would something like this do?
Image

Admittedly, it's not very pretty but does it convey the necessary information? If so, I could whip up similar diagrams for the other coordinate systems. The only part I'm foggy on is what you mean by "a location near the sun" as the origin for the "Universal" coordinate system.

Any other criticism or suggestions are welcome. At the moment, I seem to have an abundance of free time :( . If you can figure out a way to purchase it from me on the sly, Chris, I'd be happy to sell.

- a b i o g e n e s i s -

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #17by don » 30.07.2003, 16:32

chris wrote:What's really needed to clarify Celestia's various coordinate systems is a set of diagrams . . .

In this case, a picture would be worth a million words! 8O

For example, maybe something like the following?

Image
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #18by don » 30.07.2003, 16:47

:oops: Oops, I hadn't noticed the topic went to a second page. Sorry abiogenesis.

I've been looking up coordinate systems on the web this morning and found a few places with text and graphic descriptions of the Celestial/Equatorial and Geo-centered (Long/Lat) systems that I will probably include in a "For Further Information" section in the scripting guide ...

Celestial Coordinate System (graphics):
http://csep10.phys.utk.edu/astr161/lect/time/coordinates.html

Astronomy Answers (text only):
http://www.astro.uu.nl/~strous/cgi-bin/glossary.cgi?l=en&o=coordinate

Coordinate Systems in Astronomy (graphics):
http://www.astro.virginia.edu/~teacha/130_manual/node9.html

Earth Coordinate System (graphics):
http://zebu.uoregon.edu/~js/ast121/lectures/lec02.html

Coordinate Systems (graphics):
http://library.thinkquest.org/29033/begin/coordinate.htm

Coordinate system transformation (graph/math):
http://astronomy.swin.edu.au/~pbourke/projection/coords/

Coordinate Systems Overview (text-graphics):
http://www.colorado.edu/geography/gcraft/notes/coordsys/coordsys_f.html

If anyone knows of a particularly good web site, for beginners in this realm of 3-D outer space, please post the link(s), by all means. :)

Like I wrote above to Chris, a picture (or graphic) of each of the coordinate systems in Celestia will be worth a million words to folks who do not currently have this 3-D space positioning knowledge.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #19by don » 30.07.2003, 16:59

Here's another one I liked, but it doesn't include the sphere ...

Image
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #20by don » 02.08.2003, 01:25

chris wrote:Each of Celestia's modes--follow, sync orbit, lock, chase, and free--together with one or two objects defines a coordinate system.

Hi Chris,

Here is the list of Coordinate Systems allowed by setframe:

Code: Select all

   CoordSys        Celestia Mode / Astronomical Term
 --------------  ---------------------------------------------------
 chase ........  Chase -- any astronomical term for this?
 ecliptical ...  Follow?
 geographic ...  Sync Orbit
 lock .........  Lock -- any astronomical term for this?
 observer .....  Celestia mode? -- any astronomical term for this?
 universal ....  None -- no mode selected


In an earlier message, you wrote "equatorial = follow", but there is no equatorial in the list of allowable coordinate system values, only ecliptical. Are these one and the same? Is Celestial also another word for this?

What Celestia mode does "observer" relate to?

Are there any astronomical terms for Celestia's "chase", "lock", and "observer"?

Thanks again Chris!
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.


Return to “Development”