Meshing Question Basic mesh crashes :(

innovine

New member
Joined
Jun 23, 2011
Messages
29
Reaction score
0
Points
0
I've just started working with the SDK and meshes. I've got ShuttlePB.dll compiled and running. If I use the shuttlePB.dll it works ok. But as soon as I switch the mesh to my own custom mesh (a sphere with a material) then Orbiter crashes after loading. Below is the mesh I am using (exported from anim8or using urwumpes exporter):

Code:
MSHX1
GROUPS 1   ;Exporter: Msh export 070514;
LABEL mesh01
MATERIAL 1     ;material01;
TEXTURE 0
GEOM 60 36
2.768850 2.175507 3.678899 -0.303531 0.525731 0.794655 0.309017 0.190983
0.495166 3.936695 1.645255 -0.303531 0.525731 0.794655 0.572949 0.000000
-2.555299 2.175507 1.645255 -0.303531 0.525731 0.794655 0.927051 0.190983
-2.166909 -0.674156 3.678899 -0.303531 0.525731 0.794655 0.881966 0.500000
1.123597 -0.674156 4.935779 -0.303531 0.525731 0.794655 0.500000 0.500000
2.768850 -3.523818 3.678899 0.607063 0.000004 0.794654 0.309017 0.809017
5.430925 -2.435344 1.645255 0.607063 0.000004 0.794654 -0.000000 0.690983
5.430925 1.087005 1.645255 0.607063 0.000004 0.794654 -0.000000 0.309020
2.768850 2.175507 3.678899 0.607063 0.000004 0.794654 0.309017 0.190983
1.123597 -0.674156 4.935779 0.607063 0.000004 0.794654 0.500000 0.500000
-2.166909 -0.674156 3.678899 -0.303531 -0.525731 0.794655 0.881966 0.500000
-2.555299 -3.523818 1.645255 -0.303531 -0.525731 0.794655 0.927051 0.809017
0.495166 -5.285007 1.645255 -0.303531 -0.525731 0.794655 0.572949 1.000000
2.768850 -3.523818 3.678899 -0.303531 -0.525731 0.794655 0.309017 0.809017
1.123597 -0.674156 4.935779 -0.303531 -0.525731 0.794655 0.500000 0.500000
-2.555299 2.175507 1.645255 -0.982247 -0.000000 0.187592 0.927051 0.190983
-3.183730 1.087032 -1.645251 -0.982247 -0.000000 0.187592 1.000000 0.309017
-3.183730 -2.435344 -1.645251 -0.982247 -0.000000 0.187592 1.000000 0.690983
-2.555299 -3.523818 1.645255 -0.982247 -0.000000 0.187592 0.927051 0.809017
-2.166909 -0.674156 3.678899 -0.982247 -0.000000 0.187592 0.881966 0.500000
5.430925 1.087005 1.645255 0.491123 0.850651 0.187593 -0.000000 0.309020
4.802494 2.175507 -1.645251 0.491123 0.850651 0.187593 0.072949 0.190983
1.752029 3.936695 -1.645251 0.491123 0.850651 0.187593 0.427051 0.000000
0.495166 3.936695 1.645255 0.491123 0.850651 0.187593 0.572949 0.000000
2.768850 2.175507 3.678899 0.491123 0.850651 0.187593 0.309017 0.190983
0.495166 -5.285007 1.645255 0.491124 -0.850651 0.187592 0.572949 1.000000
1.752029 -5.285007 -1.645251 0.491124 -0.850651 0.187592 0.427051 1.000000
4.802494 -3.523818 -1.645251 0.491124 -0.850651 0.187592 0.072949 0.809017
5.430925 -2.435344 1.645255 0.491124 -0.850651 0.187592 -0.000000 0.690983
2.768850 -3.523818 3.678899 0.491124 -0.850651 0.187592 0.309017 0.809017
0.495166 3.936695 1.645255 -0.491123 0.850651 -0.187593 0.572949 0.000000
1.752029 3.936695 -1.645251 -0.491123 0.850651 -0.187593 0.427051 0.000000
-0.521656 2.175507 -3.678895 -0.491123 0.850651 -0.187593 0.690983 0.190983
-3.183730 1.087032 -1.645251 -0.491123 0.850651 -0.187593 1.000000 0.309017
-2.555299 2.175507 1.645255 -0.491123 0.850651 -0.187593 0.927051 0.190983
-3.183730 -2.435344 -1.645251 -0.491123 -0.850651 -0.187593 1.000000 0.690983
-0.521656 -3.523818 -3.678895 -0.491123 -0.850651 -0.187593 0.690983 0.809017
1.752029 -5.285007 -1.645251 -0.491123 -0.850651 -0.187593 0.427051 1.000000
0.495166 -5.285007 1.645255 -0.491123 -0.850651 -0.187593 0.572949 1.000000
-2.555299 -3.523818 1.645255 -0.491123 -0.850651 -0.187593 0.927051 0.809017
5.430925 -2.435344 1.645255 0.982247 0.000000 -0.187592 -0.000000 0.690983
4.802494 -3.523818 -1.645251 0.982247 0.000000 -0.187592 0.072949 0.809017
4.414104 -0.674156 -3.678895 0.982247 0.000000 -0.187592 0.118034 0.500000
4.802494 2.175507 -1.645251 0.982247 0.000000 -0.187592 0.072949 0.190983
5.430925 1.087005 1.645255 0.982247 0.000000 -0.187592 -0.000000 0.309020
-0.521656 2.175507 -3.678895 -0.607068 0.000000 -0.794650 0.690983 0.190983
1.123597 -0.674156 -4.935775 -0.607068 0.000000 -0.794650 0.500000 0.500000
-0.521656 -3.523818 -3.678895 -0.607068 0.000000 -0.794650 0.690983 0.809017
-3.183730 -2.435344 -1.645251 -0.607068 0.000000 -0.794650 1.000000 0.690983
-3.183730 1.087032 -1.645251 -0.607068 0.000000 -0.794650 1.000000 0.309017
4.414104 -0.674156 -3.678895 0.303534 0.525736 -0.794650 0.118034 0.500000
1.123597 -0.674156 -4.935775 0.303534 0.525736 -0.794650 0.500000 0.500000
-0.521656 2.175507 -3.678895 0.303534 0.525736 -0.794650 0.690983 0.190983
1.752029 3.936695 -1.645251 0.303534 0.525736 -0.794650 0.427051 0.000000
4.802494 2.175507 -1.645251 0.303534 0.525736 -0.794650 0.072949 0.190983
-0.521656 -3.523818 -3.678895 0.303534 -0.525736 -0.794650 0.690983 0.809017
1.123597 -0.674156 -4.935775 0.303534 -0.525736 -0.794650 0.500000 0.500000
4.414104 -0.674156 -3.678895 0.303534 -0.525736 -0.794650 0.118034 0.500000
4.802494 -3.523818 -1.645251 0.303534 -0.525736 -0.794650 0.072949 0.809017
1.752029 -5.285007 -1.645251 0.303534 -0.525736 -0.794650 0.427051 1.000000
0 1 2
0 2 3
0 3 4
5 6 7
5 7 8
5 8 9
10 11 12
10 12 13
10 13 14
15 16 17
15 17 18
15 18 19
20 21 22
20 22 23
20 23 24
25 26 27
25 27 28
25 28 29
30 31 32
30 32 33
30 33 34
35 36 37
35 37 38
35 38 39
40 41 42
40 42 43
40 43 44
45 46 47
45 47 48
45 48 49
50 51 52
50 52 53
50 53 54
55 56 57
55 57 58
55 58 59
MATERIALS 1
material01
MATERIAL material01
0.901961 0.850980 0.184314 1.000000
0.901961 0.850980 0.184314 1.000000
1.000000 1.000000 1.000000 1.000000  20
0.000000 0.000000 0.000000 1.000000
TEXTURES 0


---------- Post added at 11:08 AM ---------- Previous post was at 10:03 AM ----------

Nevermind, I seem to have fixed it. I deleted all the aerodynamics code and the problem went away. Perhaps thre is code which references an animation or a control surface or something not found in my mesh.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Perhaps thre is code which references an animation or a control surface or something not found in my mesh.
There are animations of 2nd and 3rd mesh groups, which don't exist in your mesh:
Code:
static UINT [highlight]GRP_LWING = 2[/highlight];
static UINT [highlight]GRP_RWING = 3[/highlight];

{...}

MGROUP_ROTATE ShuttlePB::[highlight]trans_Laileron[/highlight] (0, &[highlight]GRP_LWING[/highlight], 1, LWING_REF, LWING_AXIS, AILERON_RANGE);
MGROUP_ROTATE ShuttlePB::[highlight]trans_Raileron[/highlight] (0, &[highlight]GRP_RWING[/highlight], 1, RWING_REF, RWING_AXIS, AILERON_RANGE);
MGROUP_ROTATE ShuttlePB::[highlight]trans_Lelevator[/highlight] (0, &[highlight]GRP_LWING[/highlight], 1, LWING_REF, LWING_AXIS, -ELEVATOR_RANGE);
MGROUP_ROTATE ShuttlePB::[highlight]trans_Relevator[/highlight] (0, &[highlight]GRP_RWING[/highlight], 1, RWING_REF, RWING_AXIS, ELEVATOR_RANGE);

{...}

AddAnimationComponent ([highlight]anim_Laileron[/highlight], 0, 1, &[highlight]trans_Laileron[/highlight]);
AddAnimationComponent ([highlight]anim_Raileron[/highlight], 0, 1, &[highlight]trans_Raileron[/highlight]);
AddAnimationComponent ([highlight]anim_elevator[/highlight], 0, 1, &[highlight]trans_Lelevator[/highlight]);
AddAnimationComponent ([highlight]anim_elevator[/highlight], 0, 1, &[highlight]trans_Relevator[/highlight]);

They are referenced by control surfaces:
Code:
// aerodynamic control surface defintions
CreateControlSurface (AIRCTRL_ELEVATOR, 1.5, 0.7, _V( 0,0,-2.5), AIRCTRL_AXIS_XPOS, [highlight]anim_elevator[/highlight]);
CreateControlSurface (AIRCTRL_AILERON, 1.5, 0.25, _V( 1,0,-2.5), AIRCTRL_AXIS_XPOS, [highlight]anim_Laileron[/highlight]);
CreateControlSurface (AIRCTRL_AILERON, 1.5, 0.25, _V(-1,0,-2.5), AIRCTRL_AXIS_XNEG, [highlight]anim_Raileron[/highlight]);

You don't need to delete all the aerodynamics code. You can just not define those animations, and call CreateControlSurface without animation index (or with -1 index).
 

innovine

New member
Joined
Jun 23, 2011
Messages
29
Reaction score
0
Points
0
Thanks for pointing that out!

It is not at all obvious from looking through the code that the 2 and 3 refer to mesh groups, they just look like magic numbers. A comment above it would probably help. In this case, deleting the code is fine as I am not intending to enter any atmospheres if I can help it !
 
Top