Page 1 of 1

What is 'up' in goto script command?

Posted: 19.07.2003, 05:49
by don
Greetings Earthlings,

Anyone here know what the up parameter (a vector) is used for in the goto and gotolonglat script commands?

What do the X, Y, and Z values control?

Thanks a bunch everyone ...

-Don

Posted: 22.07.2003, 19:02
by don
Nobody uses the "up" parameter?

Hmmm, maybe Chris could help out here?

Thank you! :)

-Don

Posted: 22.07.2003, 20:57
by selden
I've never used it, but I'd expect it to be the unit vector which points up.

In other words, it specifies the orientation of the observer's viewpoint.
I.e., you can think of it as being the vector in the plane of the face of the CRT which specifies the direction that the top of the CRT is pointed toward.

Posted: 23.07.2003, 00:11
by don
Howdy Selden,

Thanks for your reply. Not sure I fully understand what you mean though. What three values would you use for what positions?

The goto command uses time (how long to get there), distance (to stop above the object), upframe (Coordinate System), and then "up". It looks like orientation is set via the setorientation command, which uses an angle (number) and an axis (vector). So, would up correlate with axis? If so, then goto doesn't allow the angle to be set, which means setorientation would still have to be used.

I just haven't done extensive testing to try and find out what the up variable actually changes in the view. it gets real time consuming, as I'm sure you already know . . . which is why I decided to ask <smile>.

Thanks again,

-Don

Posted: 28.07.2003, 21:21
by don
...
Can anyone help out here please?

Thank you.

Posted: 28.07.2003, 23:07
by selden
Don,

As I mentioned in another thread, you need to have some understanding of spherical trig, vectors and matrix algebra to begin to make sense of the various location and orientation commands used in .CEL scripts.

If you don't, what follows will be only partially understandable.

An "upframe" specifies a particular 3d coordinate system.

An "upframe" is a Euclidian 3d coordinate system which is defined in terms of 3 perpendicular axes: X, Y and Z. A particular 3d coordinate system has its axes pointing in some specific directions. For example, in the ecliptic coordinate system used by Celestia, X points toward the vernal equinox (where it was in the year 2000), Y is perpendicular to the ecliptic plane (pointing "north"), and Z is at right angles to both of them: it's in the ecliptic plane, pointing 90 degrees away from the vernal equinox.

[added later: the equatorial coordinate system differs from the ecliptic coordinate system by referencing the plane of the earth's equator instead of the plane of its orbit.]

"Up" is a unit vector. It points in the direction that is "up" for the observer: the direction that your forehead is in relation to your chin. It points to what is above the top of your head. For Celestia, it points toward what is above the top of the CRT screen.

A unit vector defines a line which is 1 unit long, with one end at the origin of the coordinate system and the other end "pointing" in whatever direction is considered to be "up". (I find it easiest to imagine it in a coordinate system that has its origin at the observer's location, but its origin can be at the origin of the main coordinate system, too.) The three values in the "up" vector are also the vector's "direction cosines": each is the projection of the direction vector on each of the three axes of the coordinate system.

When up for the observer is parallel to the coordinate system's Y axis (this is Celestia's default up vector value: [0,1,0] ), the unit vector has no X or Z components, only a Y component. Its projections onto the X and Z axes each have a length of 0. It is perpendicular (at 90 degrees) to them both. The cosine of 90 degrees is 0.

To specify an observer's viewpoint, you need three vectors:
the [x,y,z] vector specifying the coordinates of the location, the [x,y,z] direction unit vector specifying the direction the observer is facing, and the [x,y,z] unit vector specifying which direction is up. (Actually this is overconstraining the system, since the direction the observer's viewpoint is facing is always in the plane perpendicular to the "up" vector.)

While looking at Celestia's screen, if you change the direction that you have defined to be up, then the image on the screen will rotate around the center of the screen. This is what happens when you press on the Numeric Pad's 4 and 6 keys.

Does this help at all?

Posted: 29.07.2003, 06:45
by don
Thank you Selden. However, you are being overly-scientific-and-detailed, and confusing.

At the very end of your dissertation, you say "This is what happens when you press on the Numeric Pad's 4 and 6 keys." Based on this sentence, it appears that you are saying:

X and Z, in the "up" vector, of the goto command, when used while the Coordinate System is "observer"(?), define the Left(X) and Right(Z) YAW degrees from default (0).

Is this correct?

Anyway, here's how you could make it real easy on me ...

Write a script that clearly demonstrates what each value in the "up" vector does, for each of the allowable Coordinate Systems. Then, I will watch it and write down (in layman's terms) what I see.

Something like the following pseudocode:

Code: Select all

goto Earth

print "example #1"
set a coordsys value, if this is necessary
set a beginning position
print "beginning position"
set an ending position
 do the goto, with some time for me to see it happening
print "ending position"
wait a bit

print "example #2"
set a different coordsys value, if this is necessary
set a beginning position
print "beginning position"
set an ending position
 do the goto, with some time for me to see it happening
print "ending position"
wait a bit

etc.

This is what I've been doing with gotoloc's X and Y values, but not having your knowledge, I am not able to create an example from the top of my head. I'm simply shooting in the dark (random values) to see what happens.

I really DO appreciate your help Selden, if we can just find a way for you to communicate this stuff to me <smile>!

Thank you.

Posted: 29.07.2003, 12:07
by selden
Don,

Please.
Take a correspondance course in 3d trig.
I *really* don't have the time to teach it.

In the observer's coordinate system, the Y axis points up, the X axis points to the left and the Z axis points forward.

Left and right point toward +X and -X respectively in the observer's coordinate system.

One way to get a feel for these things might be to play with the 3D graphics design program Anim8or. It attaches arrows to each object pointing in the appropriate directions.

Posted: 29.07.2003, 14:21
by selden
I just realized where some mis-communication is happening.
The keyboard mapping on my system at work (from which I posted) when used with Celestia is not standard, which is rather annoying.
I was trying to refer to the keys which cause a rotation about the observer's Z axis (as defined in my posting just above). Those normally are the left and right arrow keys, not the numeric pad 4 and 6 keys.

Sorry.

Posted: 30.07.2003, 17:37
by don
selden wrote:In the observer's coordinate system, the Y axis points up, the X axis points to the left and the Z axis points forward.

To obtain the "observer's" coordsys, would I simply rotate the X, Y and Z lines in the following graphic, or would the sphere rotate with the lines (rotate entire graphic image)? ...

Image

I think Chris' idea of making graphic images to show each of Celestia's coordinate systems is a good idea. abiogenesis has offered to do them, so we'll see what they come up with.

Thank you Selden.

Posted: 30.07.2003, 17:47
by don
selden wrote:I just realized where some mis-communication is happening.
The keyboard mapping on my system at work (from which I posted) when used with Celestia is not standard, which is rather annoying.
I was trying to refer to the keys which cause a rotation about the observer's Z axis (as defined in my posting just above). Those normally are the left and right arrow keys, not the numeric pad 4 and 6 keys.

Sorry.

I'm using the Windows version and my keyboard works the way you described. Left and right arrow does the same thing as keypad 4 and 6. So, your description was okay <smile>. No worries!

By the way, thanks for the Anim8or idea. Not sure when I'll have time to play with it, but it looks like fun. I do understand 3-D spatial positioning, when using a graphic, like in the above message. Makes it real easy to understand <smile>. It's just a matter of orienting the lines according to the current Celestia coordinate system.

By the way, if you know of a particularly good web site / page that would be of interest to folks like me (non astronomer, non-astronaut, non-mathematician) who are using Celestia, please post it/them. There seems to be a million astronomy and astronomical coordinate system web sites out there.

Thanks again Selden.