Question Docking Rotation degree less then 90°?

dave1705

New member
Joined
Feb 2, 2013
Messages
24
Reaction score
0
Points
1
It is possible for a vessel, that the docking rotation degree is other than 0°, 90° or 180°?

; === Docking ports ===
BEGIN_DOCKLIST
0 0 0.32 0 0 1 0 1 0
END_DOCKLIST

For example, you can set above, which is up or down(or maybe left and right) from approaching ship point of view.
My question is, can it be for example 60° ?
In spacecraft3 it is the same like the Orbiter implementation(according to best of my knowledge).
Possibly write a dll (or a script) is the way to solve this, but coding is not one of my expertise yet.
I think the solution is in that form. :facepalm:
 
No, all you need is right there... well, if you can work with vectors, that is.

First, let's take a look at this entry:

Code:
BEGIN_DOCKLIST
[COLOR="Red"]0 0 0.32[/COLOR][COLOR="Lime"] 0 0 1[/COLOR] [COLOR="Blue"]0 1 0[/COLOR]
END_DOCKLIST

It consists of three groups of three numbers, each making up a vector (that is, a structure that stores an X, Y and Z value). The first group is position, it says where relative to the vessels center of gravity the port will be.
The second and third are direction and rotation. They are what you need. These are directional vectors, not positional ones. I.e. they point in a direction, and that direction is where the docking port points. The first of these two is the direction the port faces, the second is where the ports "up" direction is. We'll only look at the direction currently.

In the example, it does not point along the X axis (0), it does not point along the Y axis (0), but points along the Z axis (1). So I can tell from this number that the docking port is forward facing.

If I would turn it to 1 0 0 it would face along the X axis, i.e. sideways. So let's assume that you want a docking port that points sideways up at 45 degrees. A directional vector for that direction could look like this: 1 1 0
It points along the X axis by the same amount as it points along the Y axis, ergo it's pointing at 45 degrees. It doesn't point along the Z axis at all. if it were 1 1 1, then it would be facing up and forward by 45 degrees, but here things get difficult to describe, so we'll leave it at that.

Now, there's a little hitch here: Directional vectors have to be normalised. That means that the length of the vector (or the radius, if you imagine a directional vector as describing a point on a sphere) has to be equal to 1. Currently, our vector length is 1.414. This is where trigonometry comes in, and this is where it gets difficult to explain without knowing how much you already know.
As long as you have only two axes it's relatively simple, going with Pythagoras' a^2+b^2=c^2, which means that a normalised vector pointing sideways up by 45 degrees would look like this: 0.707 0.707 0 (as sqr(0.707^2 * 2) = 1).

The next problem will be to get the up vector, which has to be perpendicular to this vector or unspeakable things will happen (like vessels distorted right out of reality). However, before we tackle that, I would like to ask if I was at all helpful with the above. It's difficult to explain stuff without knowing what the other one knows and what he doesn't.
(also, there's more gifted math teachers here than I am...)
 
Last edited:
No, all you need is right there... well, if you can work with vectors, that is.

First, let's take a look at this entry:

Code:
BEGIN_DOCKLIST
[COLOR="Red"]0 0 0.32[/COLOR][COLOR="Lime"] 0 0 1[/COLOR] [COLOR="Blue"]0 1 0[/COLOR]
END_DOCKLIST

It consists of three groups of three numbers, each making up a vector (that is, a structure that stores an X, Y and Z value). The first group is position, it says where relative to the vessels center of gravity the port will be.
The second and third are direction and rotation. They are what you need. These are directional vectors, not positional ones. I.e. they point in a direction, and that direction is where the docking port points. The first of these two is the direction the port faces, the second is where the ports "up" direction is. We'll only look at the direction currently.

In the example, it does not point along the X axis (0), it does not point along the Y axis (0), but points along the Z axis (1). So I can tell from this number that the docking port is forward facing.

If I would turn it to 1 0 0 it would face along the X axis, i.e. sideways. So let's assume that you want a docking port that points sideways up at 45 degrees. A directional vector for that direction could look like this: 1 1 0
It points along the X axis by the same amount as it points along the Y axis, ergo it's pointing at 45 degrees. It doesn't point along the Z axis at all. if it were 1 1 1, then it would be facing up and forward by 45 degrees, but here things get difficult to describe, so we'll leave it at that.

Now, there's a little hitch here: Directional vectors have to be normalised. That means that the length of the vector (or the radius, if you imagine a directional vector as describing a point on a sphere) has to be equal to 1. Currently, our vector length is 1.414. This is where trigonometry comes in, and this is where it gets difficult to explain without knowing how much you already know.
As long as you have only two axes it's relatively simple, going with Pythagoras' a^2+b^2=c^2, which means that a normalised vector pointing sideways up by 45 degrees would look like this: 0.707 0.707 0 (as sqr(0.707^2 * 2) = 1).

The next problem will be to get the up vector, which has to be perpendicular to this vector or unspeakable things will happen (like vessels distorted right out of reality). However, before we tackle that, I would like to ask if I was at all helpful with the above. It's difficult to explain stuff without knowing what the other one knows and what he doesn't.
(also, there's more gifted math teachers here than I am...)

Oh, thank you for the comprehensive answer! I didn't think, that the last two group working like vectors.:facepalm:
I know the first group is coordinates of a point and the origin is the center of the object.
I did interpret the second as x,y,z axis on which the third group rely.
And the third group as they are like states or something like: 1,0,-1 --- up, 0. and down.
Ah, I'm an idiot... Now, i can calculate it.
But again thanks for clearing up this thing! :D
 
Last edited:
The "Direction" and "Rotation" inputs are essentially declaring the horizontal and vertical axes of the docking port. Weird :censored: happens when those axes are not perpendicular or of equal length.

Once you understand that, calculating the vectors for an "off axis" docking port should be reasonably straight forward
 
Back
Top