General Question Can I change docking port angles.

Kendo

New member
Joined
Oct 16, 2007
Messages
589
Reaction score
1
Points
0
I have a ship which I,ve added a couple of docking ports. The problem is, on one of them, due to the shape of the ship, I need to change the angle slightly from the standard 90%, so it fits level with the ship. Can this be done using Spacecraft3. Many thanks, Ken.
 

ADSWNJ

Scientist
Addon Developer
Joined
Aug 5, 2011
Messages
1,667
Reaction score
3
Points
38
Oh interesting! I was looking for a ship with irregular angled docking ports to test out my docking port rotation matrices.

One thing though ... will you also have a way to gimbal the thrusters in docking mode, so e.g. Pitch Up and Yaw Right act at right angles to the docking alignment? Otherwise it will be a bear to fly.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Yes, you will need to alter the DIR and ROT parameters in the .ini file. The resulting vector must be normalized (sqrt(X^2+Y^2+Z^2)=1) and ROT must be a right angle to the DIR vector. If you're only rotating in one dimension, you could use simple trigonometry to find the new values, otherwise, you'd need either rotation matrices, or normalize a vector that describes the DIR and ROT.
 

Kendo

New member
Joined
Oct 16, 2007
Messages
589
Reaction score
1
Points
0
I,m lost lol, this is one line I have. What figures do I need to change to alter the alignment.
For example 5 degrees to the right. The first three figures are the exact central position. I need to angle it slightly to the right.
-18.9 -22.11 -8.12 -1 0 0 0 1 0 023
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,295
Reaction score
3,264
Points
203
Location
Toulouse
Where does that 023 comes from ?
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,295
Reaction score
3,264
Points
203
Location
Toulouse
All is in that sequence of numbers :

-1 0 0 0 1 0

Which hide the two DIR and ROT vectors described above, each expressed in [x ; y ; z] :

DIR V_[-1 ; 0 ; 0]
ROT V_[0 ; 1 ; 0]
 

C3PO

Addon Developer
Addon Developer
Donator
Joined
Feb 11, 2008
Messages
2,605
Reaction score
17
Points
53
I need to angle it slightly to the right.
-18.9 -22.11 -8.12 -1 0 0 0 1 0 023

Not sure what you mean by "to the right". The DIR vector -1 0 0 points straight out the left side.
If you want it to point 5° forward the entry would be:
-18.9 -22.11 -8.12 -0.996195 0 0.087156 0 1 0 023
And 5° aft would be:
-18.9 -22.11 -8.12 -0.996195 0 -0.087156 0 1 0 023
 

Kendo

New member
Joined
Oct 16, 2007
Messages
589
Reaction score
1
Points
0
Thanks guys.
C3PO, if I change the numbers on just one side,(6th block of figures) does anything get distorted visually. It lines up better with these figures.
-8.32 -3.78 11.705 -0.996195 0 -0.067156 0 1 0 023

Or do both sets of figures have to add up to something. something?
Also how did you work out these figures?. Many thanks.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
C3PO just changed the DIR_V vector for the docking port using trigonometry
Your initial vector for "straight left" is -1 0 0. This is because the normal equation for the vector is sin(theta); 0; cos(theta); "Straight left" is -90 degrees, and sin(-90) = -1 and cos(-90) = 0

To get 5 degrees forward, C3PO did the sin and cos of -85 degrees, to get the vector -0.996195 0 0.087156

5 degrees aft is the sin and cos of -95 degrees, resulting in the vector -0.996195 0 -0.087156
 

C3PO

Addon Developer
Addon Developer
Donator
Joined
Feb 11, 2008
Messages
2,605
Reaction score
17
Points
53
:hesaid:

And the vector should have a length of 1.0.

---------- Post added at 03:07 PM ---------- Previous post was at 02:56 PM ----------

I still have a very old post-it on my desk.

I drew it when I first started out tinkering with Orbiter, and I still use it to check the directions.
 

Kendo

New member
Joined
Oct 16, 2007
Messages
589
Reaction score
1
Points
0
Thanks guys, you have been a great help. :cheers:
Is there an easy way to get the figures,ie a converter, or do I have to work it out in my head?
 
Top