Meshing Question SOLVED: Can't get very basic mesh to load, what is wrong?

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
2,927
Reaction score
1,216
Points
113
Location
Massachusetts
I am just tinkering with the Orbiter mesh format and wanted to see if I could make a simple triangle mesh that could be loaded into a scenario. I have a Triangle.msh file in the Meshes directory which contains the following very basic mesh info (3 vertices and two triangles, with opposing left-handed normals).
MESHX1
GROUPS 1
GEOM 3 2
0.0 0.0 0.0
0.5 0.866025403784439 0.0
1.0 0.0 0.0
0 1 2
0 2 1
Under Config/Vessels I have a Triangle.cfg file that contains the following:
; === Configuration file for Triangle ===

Classname = Triangle
Meshname = Triangle
I am trying to load this using a scenario file modified from the Delta Glider at KSC scn file:
BEGIN_HYPERDESC
<h1>KSC Update</h1>
<p>A Triangle waits for takeoff at SLF Runway 33 of the new and improved Kennedy Space Center.</p>
END_HYPERDESC

BEGIN_ENVIRONMENT
System Sol
Date MJD 54723.6694482476
Script ksc_sweep
END_ENVIRONMENT

BEGIN_FOCUS
Ship Triangle
END_FOCUS

BEGIN_CAMERA
TARGET Triangle
MODE Extern
POS 799.63 36.01 -15.36
TRACKMODE TargetRelative
FOV 40.00
END_CAMERA

BEGIN_HUD
END_HUD

BEGIN_MFD Left
END_MFD

BEGIN_MFD Right
END_MFD

BEGIN_VC
END_VC

BEGIN_SHIPS
Triangle:Triangle
STATUS Landed Earth
POS -80.6825940 28.5969240
HEADING 330.01
END
END_SHIPS
With the above, when I start the scenario, Orbiter crashes.

If I simply replace Meshname = Triangle with Meshname = Carina, the scenario loads properly and loads the Carina mesh as expected, so it seems the problem is something with the Triangle.msh. I'm not sure what the problem is as it was really meant to be as basic as possible.

What am I missing?
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
843
Reaction score
323
Points
78
Website
francisdrakex.deviantart.com
Hi, maybe a material is necessary, even if it is empty.

I made a triangle in Gmax and exported it to an Oribter Mesh. The msh looks this:

MSHX1
GROUPS 1
LABEL NGon01
MATERIAL 0
TEXTURE 0
GEOM 3 1 ; NGon01
-48.2079 0.0 0.0 0.0 0.0 1.0
24.104 41.7493 0.0 0.0 0.0 1.0
24.104 -41.7493 0.0 0.0 0.0 1.0
0 2 1
MATERIALS 0
TEXTURES 0
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
2,927
Reaction score
1,216
Points
113
Location
Massachusetts
That seems to be the issue. Adding MATERIAL 0 and TEXTURE 0 to the group was not needed, but the triangle rendered as partially transparent if these were removed. I also needed to supply the vector normals for the vertices. I tried the NONORMALS flag but it didn't work. I had to define those normals for some reason. I removed the normals and now they work?

This now works appropriately:

MSHX1
GROUPS 1
GEOM 3 2
0.0 0.0 0.0
0.5 0.866025403784439 0.0
1.0 0.0 0.0
0 1 2
0 2 1
But this is exactly what I had initially, and I kept getting errors? I am wondering if I had a stray space somewhere or some other fiddly formatting issue?
 
Last edited:

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
4,893
Reaction score
1,480
Points
138
From the documentation (3DModel.pdf):
The first group in the mesh must specify a material index, otherwise the result is undefined. (...) The first group in the mesh must specify a texture index, otherwise the result is undefined.


Also, the mesh in the 3rd post is missing one coordinate: "0.5 0.866025403784439".
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
2,927
Reaction score
1,216
Points
113
Location
Massachusetts
From the documentation (3DModel.pdf):
The first group in the mesh must specify a material index, otherwise the result is undefined. (...) The first group in the mesh must specify a texture index, otherwise the result is undefined.


Also, the mesh in the 3rd post is missing one coordinate: "0.5 0.866025403784439".
That was a copy/paste typo, I updated with the missing coordinate.

The mesh seems to work without setting MATERIAL or TEXTURE, but the visible triangle is transparent when they aren't applied.
Also most likely another cause of problem : MESHX1 vs MSHX1
I think this was the root of the problem. MESHX1 fails, MSHX1 works.

It's always the mundane details that get you.

Triangle on Runway.png
 
Top