# SDK QuestionTouchdown points definition 2016

#### gattispilot

I hope some one can help me figure out how to define the touchdown points for 2016.

I have looked at the Delta Glider. I have a red cube at the touchdown points.

Code:
static const DWORD ntdvtx_geardown = 13;
static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = {
{_V( 0   ,-2.57,10   ), 1e6, 1e5, 1.6, 0.1},
{_V(-3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
{_V( 3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
{_V(-8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
{_V( 8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
{_V(-8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
{_V( 8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
{_V(-8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
{_V( 8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
{_V(-8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
{_V( 8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
{_V( 0   , 2   , 6.2 ), 1e7, 1e5, 3.0},
{_V( 0   ,-0.6 ,10.65), 1e7, 1e5, 3.0}
};
ShuttleA

Code:
static const int ntdvtx = 16;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
{_V(-3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
{_V(-3  ,-3.05,-13.5), 3e6,   3e5,   3},
{_V( 3  ,-3.05,-13.5), 3e6,   3e5,   3},
{_V( 3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
{_V(-7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
{_V( 7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
{_V(-1.5, 3   ,13.5 ), 3e7,   3e6,   3},
{_V( 1.5, 3   ,13.5 ), 3e7,   3e6,   3},
{_V(-1.3, 2.8 ,17   ), 3e7,   3e6,   3},
{_V( 1.3, 2.8 ,17   ), 3e7,   3e6,   3},
{_V(-1.8, 0   ,18.3 ), 3e7,   3e6,   3},
{_V( 1.8, 0   ,18.3 ), 3e7,   3e6,   3},
{_V(-1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
{_V( 1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
{_V(-3.3, 0   ,-14.9), 3e7,   3e6,   3},
{_V( 3.3, 0   ,-14.9), 3e7,   3e6,   3}
};

So it looks like the touchdown points are also defining the shape of the vessel?

So with the older version it was 3 points. Center and left and right rear. It told rotation and direction.

But the Shuttle A has a rectangle of the pads touching the ground.

from the sdk:
Code:
• VECTOR3 pos collision point position (vessel frame) • double stiffness suspension stiffness coefﬁcient • double damping suspension damping coefﬁcient • double mu isotropic/lateral friction coefﬁcient • double mu_lng longitudinal friction coefﬁcient (only used for ﬁrst 3 points)
So we get the vector 3 point. But the other values I don't understand.

Code:
17.57.3.327 voidVESSEL::SetTouchdownPoints( constVECTOR3&pt1, constVECTOR3&pt2, constVECTOR3&pt3 ) const
Deﬁnes the three points deﬁning the vessel's ground contact plane.
Deprecated This method has been replaced by VESSEL::SetTouchdownPoints(const TOUCHDOWNVTX∗,DW← ORD)const Parameters pt1 touchdown point of nose wheel (or equivalent) pt2 touchdown point of left main wheel (or equivalent) pt3 touchdown point of right main wheel (or equivalent)
Note
The points are the positions at which the vessel's undercarriage (or equivalent) touches the surface, speciﬁed in local vessel coordinates. The order of points is signiﬁcant since it deﬁnes the direction of the normal. The points should be speciﬁed such that the cross product pt3-pt1 x pt2-pt1 deﬁnes the horizon "up" direction for the landed vessel (given a left-handed coordinate system). Modifying the touchdown points during the simulation while the vessel is on the ground can result in jumps due to instantaneous position changes (inﬁnite acceleration). To avoid this, the
touchdown points should be modiﬁed gradually by small amounts over time (proportional to simulation time steps). This method is retained only for backward compatibility. Vessels should now use Set← TouchdownPoints(const TOUCHDOWNVTX∗,DWORD)const to deﬁne a convex hull of touchdown points. The touchdown stiffness and damping parameters are guessed according to the vessel empty mass. Therefore, SetTouchdownPoints should be called after deﬁning the empty vessel mass with SetEmptyMass.

Last edited:

#### N_Molson

Donator
For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?

#### gattispilot

Thanks. I get that. But with 4 points how does it know which way is forward?

I assume that the higher the value more dampness and stiffness, right.

So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?

For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?

#### martins

##### Orbiter Founder
Orbiter Founder
For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
Exactly. Instead of just defining 3 touchdown points, you now describe the complete convex hull of the vessel, so that surface interactions are defined for any vessel orientation. The 3-point definition is only retained for backward compatibility, but it will not correctly define the surface interaction any more, since it describes the vessel as a flat triangle. You need at least 4 non-coplanar points to define a volume (tetrahedron). In practice, you should specify enough points to describe a convex polyhedron that provides a reasonable surface impact volume from all angles. (Don't use more points than necessary, to keep performance high. In particular _don't_ use all the vertices of your vessel mesh!)

The two values after the position are the stiffness parameter b and damping parameter a of the damped harmonic oscillator describing the surface interaction:

$m \ddot x + a \dot x + b x = 0$

The third parameter is the friction coefficient.
For the first 3 touchdown points you can define two separate friction coefficients: a longitudinal one (e.g. rolling landing gear) and a transversal one (movement perpendicular to the landing gear position).

Isn't that described in the API reference?

#### jedidia

##### shoemaker without legs
Thanks. I get that. But with 4 points how does it know which way is forward?
Convention. Forward on a vessel is always Z+, and the "correct" plane parallel to the ground in landed state is computed from the first three touchdown points in the list.

Isn't that described in the API reference?
Kind of... as far as I remember, it just says "damping", "longitudional friction" and "lateral friction" or something along those lines. Enough to get a rough idea what you're dealing with, but not enough to find the equations in question when you don't know them yet.

Last edited:

#### martins

##### Orbiter Founder
Orbiter Founder
So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?
Low stiffness makes the vessel jump more. It's the equivalent of a soft spring, so exerts a low force at large spring displacement.

However, be careful when increasing the stiffness. A higher stiffness also increases the eigenfrequency of the system, which can lead to numerical instabilities in particular at higher time accelerations (large forces even at small displacements).

Regarding damping: look up "critical damping" for computing damping values that return the spring to equilibrium fastest and don't induce oscillations.

#### gattispilot

So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.

Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?

#### martins

##### Orbiter Founder
Orbiter Founder
So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.
There is one subtlety here: Orbiter treats the first 3 touchdown points specially. So even if you define a car with 4 wheel contact points in a rectangle, you should adhere to that pattern: Make a "virtual" contact p1 between the two front wheels. The two back wheels are contacts p2 and p3. Set points p4 and p5 to the actual front wheel positions. Add further points for describing the box volume.

Then apply the proper friction coefficients for the first 3 points. p1 should probably have double the friction coefficient of the back wheel since it simulates two wheels.
Points p4 and p5 can have friction coefficient 0, since they are only used for impact simulation. (Its probably best to lift p4 and p5 a bit compared to p1, to make sure p1 has ground contact on uneven ground).

Edit: Or just don't define the two front wheel points at all. That will make them sink into the ground a bit when the car is tilted, but this shouldn't happen in normal operation anyway, and it avoids some potential side effects.
Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?
Make the damping critical.

#### gattispilot

Thanks.

Not sure what you mean here.

Make the damping critical.

Ok I will add an image of vessel and points later

#### 4throck

##### Enthusiast !
Just to add that on my experiments with SC4 + Orbiter 2016 and defining just 3 points, the order of the points is not trivial.

Depending on how you set those up, your ship will tend to flip on landing.

Makes sense, since some coordinate groups might give you a good "up" normal, but invert your "left/right" or "front/back" forces, flipping the ship.

So
LAND_PT1=(0,-12.1,9)
LAND_PT2=(-4,-12.1,-9)
LAND_PT3=(4,-12.1,-9)

is different from
LAND_PT1=(0,-12.1,9)
LAND_PT2=(4,-12.1,-9)
LAND_PT3=(-4,-12.1,-9)

#### martins

##### Orbiter Founder
Orbiter Founder
This, however, is explained in the manual, I'm pretty sure. As regards to surface friction, Orbiter infers the forward direction from the first 3 contact points p1, p2, p3 as p1 - 0.5*(p2+p3) and the lateral direction as p3-p2.

So those three points indeed don't commute.

#### Ripley

##### Tutorial translator
Donator

Since the importance of this issue and for others to find it more easily, can a mod please edit the title?
For example, from "Tounchdown point definition 2016" to "Touchdown points definition 2016"?

#### gattispilot

I fixed it. Thanks

---------- Post added at 04:17 PM ---------- Previous post was at 12:32 PM ----------

OK. so my ler here are the points.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
{ _V(0, -2.166, 1.5), 1e6, 1e5, 1.6, 0.2 },
{ _V(-2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
{ _V(2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
{ _V(-2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
{ _V(2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
{ _V(-2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
{ _V(2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
{ _V(-2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 },
{ _V(2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 }
};
In the image the green dots are the first 3.

So at the start it is good. I throttle forward. Other than a slight deviation of forward it is ok. Til I hit a hill? And I flip a couple of times and lay on the side.

---------- Post added 09-09-16 at 06:06 AM ---------- Previous post was 09-08-16 at 04:17 PM ----------

I try on Earth at Canaveral pad 1. Seems there is a hill there?

What is odd is Guess it rolls down as I have applied some forward thrust to keep her in place.

#### Donamy

Donator
Beta Tester
maybe it needs more friction.

#### gattispilot

Well I double friction.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.4 },
{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
{ _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
{ _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
{ _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};
I know if is a Space simulator so maybe I am expecting too much for ground travel?

One thing I noticed the shadow seem to not be affected by the surface. Even though the wheels are covered you see the full shadow.

ouch. I started to climb a hill and it spun around and landed in the surface.

#### fred18

Donator
One question: if i define the touchdown points with the old definition what would be the damping and stiffness parameters? They will be some sort of default ones, but i found no way to "get" them

#### gattispilot

I went back to DG settings and did ok for a bit but then I flipped and ended up this way. I hoped by exit and reloading the vessel would be upright.

Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.4 },
{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
{ _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
{ _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
{ _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
{ _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};

Code:
LER:LER4
STATUS Landed Moon
POS -33.4434380 41.1179350
ALT 1.500
AROT -56.919 41.280 -125.223
RCSMODE 0
AFCMODE 7
PRPLEVEL 0:0.999482
NAVFREQ 0 0
WHEELROT 0.000000
END
So has any one tried to go up their own mesh? Like roll a crawler up a ramp.

#### jedidia

##### shoemaker without legs
So has any one tried to go up their own mesh?
That doesn't work. Touchdown points interact only with terrain, not with other touchdwon points.

#### gattispilot

That's sad. So maybe someone will figure out how to make the terrain raise up like a ramp for launchpad. Or landing pads above the surface.

What is fun/interesting is to drive a delta glider on the ground. It has no issues that's why I went with the dg specs

---------- Post added 09-13-16 at 05:13 AM ---------- Previous post was 09-12-16 at 08:18 AM ----------

So I used 3 points.
Code:
static const int ntdvtx = 3;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.8 },
{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.4 },
{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.4 }//,
//    { _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
//    { _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
//    { _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};
I rotate the LER wheels 90 degrees which rotates the thrust.
Code:
SetThrusterDir(th_main[0], _V(sinTurn, 0, cosTurn));
SetThrusterDir(th_retro[0], _V(-sinTurn, 0, -cosTurn));
Well the vessel flip and landed under the surface.

Why does the Surface MFD say the Alt is -2.57. It does this on the DG also.

Code:
LER:LER4
UCGO @@0,1,0,0,
STATUS Landed Moon
POS -33.4397132 41.1163117
ALT -2.171
AROT 147.458 47.031 -71.960
RCSMODE 0
AFCMODE 7
PRPLEVEL 0:0.999803
NAVFREQ 0 0
WHEELROT 0.000000
END

Last edited:

#### turtle91

##### New member
Why does the Surface MFD say the Alt is -2.57. It does this on the DG also.
Because it measures the "sea"-level altitude.
If you are i.e. parking at Brighton Beach, you are sitting in a hole...below standard sea-level.