SDK Question About Touchdown Vertexes and "convex hulls" (again)

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,290
Reaction score
3,258
Points
203
Location
Toulouse
I was curious if the order in which you define the touchdown vertexes for a vessel matters or not for Orbiter to decide the shape of the ground collision box.

Say I want to model some kind of capsule that looks more or less like that, very much a cone but with an angle on the slope :

Sans titre.png

So am I correct to define 3 series of vertices forming hexagonal (too keep it simple) rings r1, r2 and r3, in that order, so that I'll have 18 vertices ?

Is it a valid "convex hull" definition ? :unsure:
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,927
Reaction score
2,937
Points
188
Website
github.com
Should work, but you maybe need to have the first 3 points (which are special) placed equally around the bottom, like so: 0, 4, 1, 5, 2, 3.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,290
Reaction score
3,258
Points
203
Location
Toulouse
Should work, but you maybe need to have the first 3 points (which are special) placed equally around the bottom, like so: 0, 4, 1, 5, 2, 3.

OK thanks, makes sense, as I understand it those 3 points are the default ones on which "stands" the vessel (if you spawn in on a planet surface as "landed" and provide no other specific orientation information).

And I found out that you have to define those points counterclockwise, else the vessel starts "inverted". I think it is a consequence of Orbiter being "left-handed". So to be consistent I'm redefining all points in that counterclockwise logic.
 
Last edited:

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
I was curious if the order in which you define the touchdown vertexes for a vessel matters or not for Orbiter to decide the shape of the ground collision box.
In general no, because as I understand it, Orbiter doesn't actually create a box. It just checks each point for contact. As GLS mentioned, though, the first three points are treated special, as they define the "ground plane" of the vessel (i.e. the proper way for the vessel to be oriented when on the ground).
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
Can one have more than one touchdown points. For instance on the Alpaca. I want the bottom of the gearpad to have touchdown points so the pad does't stick in the ground. For visually effect I suppose one could just have the 4 legs retract separately rather than as one
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
You can have as many touchdown points as you like, but I don't think I understand your use case from your description. Maybe a screenshot would help...
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,290
Reaction score
3,258
Points
203
Location
Toulouse
Can one have more than one touchdown points. For instance on the Alpaca. I want the bottom of the gearpad to have touchdown points so the pad does't stick in the ground. For visually effect I suppose one could just have the 4 legs retract separately rather than as one

One of the big changes with Orbiter 2016 is that "touchdown points" are no more defined as a 2D plane (like a triangle), but as a geometric 3D shape. So, you need a minimum of 4 points, and in that case you should define something like a pyramid (that will be your "ground collision box"). You can adjust friction and spring/damping parameters for each point individually.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
Confused. So like a Lunar Lander with 4 legs. Should the TD points define the point where the 4 legs touch the surface. Like the Alpaca is parked on a Hill and 2 of the gear look good, But 2 are sunk in the ground
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,355
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Confused. So like a Lunar Lander with 4 legs. Should the TD points define the point where the 4 legs touch the surface. Like the Alpaca is parked on a Hill and 2 of the gear look good, But 2 are sunk in the ground
For a 4 legged lander, you would need 5 points.

One for each leg. And one to be the "top".

Picture an imaginary solid residing inside your vessel that interacts with the ground. The points define this sould.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
So 4 points where the legs touch. and 1 to be top?

I guess for the rover it needs 4 at the point of where the tires hit the ground?

Can you show an example
 

Attachments

  • FLEXROVEVA4.jpg
    FLEXROVEVA4.jpg
    97 KB · Views: 8

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
First you need a triangle that defines the up normal. Those need to be the first three touchdown points. Then you can define 4 more for your landing legs. I think it should work when you make your "base plane" higher than the legs, but I'm not sure exactly. It's a long time ago since I've worked with these things.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
This is what I have currently:
SetTouchdownPoints (tdvtx_geardown, ntdvtx_geardown);

const double pesototal=LEM_AscentMASS+LEM_DescentMASS+LEM_DescentFUEL+LEM_AscentFUEL; const double xtx_target=-0.1; const double xtst=(-1)*(pesototal*9.80655)/(3*xtx_target); const double xtda=0.9*(2*sqrt(pesototal*xtst)); static const DWORD ntdvtx_geardown = 4; static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = { {_V(0 ,- 4.121, 4.4), 70007.4, 49275.1, .1, .2}, {_V(-3.4641, -4.121, - 2), 70007.4, 49275.1, 3, .2}, { _V(3.4641, -4.121, - 2), 70007.4, 49275.1, 3, .2}, { _V(0,4,0), 70007.4, 49275.1, 3, .2} };

the mesh the 4 pts are really x,z -3,3.4 3,3,4 -3,-3.4 and 3,-3.4 y 4.156
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,882
Reaction score
2,133
Points
203
Location
between the planets
From the screenshot you posted of your model, it is not clear where its Z-axis is. From that screenshot it looks like a tailsitter, i.e. I'd expect Z to be perpendicular to the ground, while something like the DG has its Z-axis parallel to the ground when landed. This would be a very important information to know to make any suggestion. Could you turn on vessel axes display (I think you can turn that on in the F9 menu, but maybe it was a D3D9 debug feature...?) and take a screenshot of the landed vessel?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
Here are closer images. As you can see the 2 gear on the left are sunk in
 

Attachments

  • alpacaaxis2.jpg
    alpacaaxis2.jpg
    24.7 KB · Views: 6
  • alpacaaxis.jpg
    alpacaaxis.jpg
    39.5 KB · Views: 6

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,927
Reaction score
2,937
Points
188
Website
github.com
That is probably from not having an even weight distribution on each touchdown point. Put a touchdown point exactly at the bottom of each gear, and one on top of the vessel (total 5). This way, each gear should see the same weight, plus, you can land a bit sideways and whichever gear touches down first "will see" the ground as there is a touchdown point in there, and it will look and work much better that 3 points for 4 gears.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
Thanks. I have this. But I think the order is wrong?
static const DWORD ntdvtx_geardown = 5; static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = { {_V(0 ,2, 0), 70007.4, 49275.1, .1, .2},//TOP {_V(-3.4641, -4.1609, 3.452), 70007.4, 49275.1, 3, .2}, { _V(3.4641, -4.1609, 3.452), 70007.4, 49275.1, 3, .2}, {_V(-3.4641, -4.1609, -3.452), 70007.4, 49275.1, 3, .2}, { _V(3.4641, -4.1609, -3.452), 70007.4, 49275.1, 3, .2}, };
 

Attachments

  • ALPACATDPOINTS.jpg
    ALPACATDPOINTS.jpg
    67.4 KB · Views: 3

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,927
Reaction score
2,937
Points
188
Website
github.com
I don't think the order matters, except for the first 3 points, which have extra parameters for wheels, but those should not be needed here. Put point 5 at the top, so the first 3 are on the ground.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
/ point, stiffness, dampening, isotropic/lateral friction coefficient, longitudinal friction coefficient (only used for first 3 points) const double pesototal=LEM_AscentMASS+LEM_DescentMASS+LEM_DescentFUEL+LEM_AscentFUEL; const double xtx_target=-0.1; const double xtst=(-1)*(pesototal*9.80655)/(3*xtx_target); const double xtda=0.9*(2*sqrt(pesototal*xtst)); static const DWORD ntdvtx_geardown = 5; static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = { {_V(-3.4641, -4.1609, 3.452), 70007.4, 49275.1, 3, .2}, { _V(3.4641, -4.1609, 3.452), 70007.4, 49275.1, 3, .2}, {_V(-3.4641, -4.1609, -3.452), 70007.4, 49275.1, 3, .2}, { _V(3.4641, -4.1609, -3.452), 70007.4, 49275.1, 3, .2}, {_V(0 ,2, 0), 70007.4, 49275.1, .1, .2},//TOP };

but now she is upside down
 

Attachments

  • alpacaupsidedown.jpg
    alpacaupsidedown.jpg
    46 KB · Views: 3

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,927
Reaction score
2,937
Points
188
Website
github.com
That probably has to do with the AROT scenario parameter, which affects landed vessels. Can you try and land it, or using the Scenario Editor, correct the orientation and drop it from 1m or so, to check that it lands upright?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,729
Reaction score
2,696
Points
203
Location
Dallas, TX
So I apply hover and got her above the surface and the correct orientation. And cut the hover and let her drop. She landed correctly but then reverted to under the surface
 
Top