Question Exporting a geometry to Orbiter's mesh file format

Marijn

Active member
Joined
Mar 5, 2008
Messages
755
Reaction score
166
Points
43
Location
Amsterdam
Hello all,

For the add-on I am working on, I would like some help or advice on Orbiter's mesh file format.

The plan is to create meshes on the fly for any asteroid in the Asterank database for use in Orbiter 2016. Since my application is running on Google Apps Script, I did have a look at some Javasript frameworks for 3D modeling. At the moment, I am playing with Three.js. I am also looking at Babylon.js.

I've no experience with 3D modeling, so I could use some advice on various things. I know what vertices are. And faces. That's about it at the moment.

Creating an asteroid with Three.js turns out to be really easy. All it takes are a few lines of code. The hard part seems to be to export the Three.js geometry into Orbiter's mesh format. My plan, perhaps naive, is to iterate the arrays of vertices and faces of the geometry to script the Orbiter mesh. Orbiter's mesh files do not look overly complicated to me so I think I can figure it out eventually by eyeballing it. However, if I take a look at existing exporters included in the frameworks, they all look complicated to me. So I might underestimate the complexity. Perhaps the order of the arrays is not what Orbiter requires. Then I'll have no idea what to do.

Orbiter's manual says that it uses a proprietary mesh file format. Does that mean the format is only used by Orbiter and that I cannot expect to find much more information about it besides the manual? Is there another format which is like Orbiter's format which I could inspect for inspiration?

I like to have an existing model in both Orbiter and another common format which includes everything my exporter should be able to handle. Any suggestions or a link to a download?

Thanks for any help or advice.
 

Majid

Active member
Joined
Oct 31, 2014
Messages
156
Reaction score
27
Points
43
Interesting proposed use of three.js. You'll have to write your own three.js exporter to convert three.js geometry into Orbiter meshes. Alternatively, you can use an existing converter to convert the geometry into a well known format like OBJ then converting the OBJ to Orbiter's mesh format.

This is an unusual way of going about it. Most add-on developers just model their meshes in a 3D modeling software then export to Orbiter's mesh format using community written plugins.

For example:

- http://www.anim8or.com/ -> Here's a tiny but powerful 3D modeling software.

- [ame="https://www.orbithangar.com/searchid.php?ID=2698"]Anim8or 0.95b .msh export script 070514[/ame] -> This is a plugin for the above tool to allow for the export of the 3D models to Orbiter.

- [ame="https://www.orbithangar.com/searchid.php?ID=2740"]Mesh Wizard 1.9d[/ame] -> A tool that allows you to look at Orbiter mesh files. It can also reverse convert models from Orbiter mesh into a file that anim8or can open and work with.

- A far more comprehensive and robust tool for 3D modeling is blender:
And here's a plugin to export to Orbiter mesh format

So personally I'd drop three.js, unless you plan on somehow integrating the JS visualizations into Orbiter. You can model stuff in a 3D modeling software, then export to orbiter. anim8or is small, fast and easy to get started with. Blender is a professional grade tool. I'd start with anim8or then transition to Blender.

Also check out orbitersdk\doc\3DModel.pdf pg 5 and on to see orbiter mesh file definition.
 
Last edited:

Marijn

Active member
Joined
Mar 5, 2008
Messages
755
Reaction score
166
Points
43
Location
Amsterdam
Thanks for the input. I think the Anim8or export script will prove very useful to my case. I just installed Blender yesterday (2.79b with glTF export add-on) and 2.80 beta. I will install the Blender 2.63 + to Orbiter import/export addon. Good idea.

Alternatively, you can use an existing converter to convert the geometry into a well known format like OBJ then converting the OBJ to Orbiter's mesh format.

Converting the OBJ, or any format for that matter, to Orbiter is the problem part. I cannot use any Windows tools. Everything has to be done in a single step serverside in the Google Apps Script Javascript sandbox without touching a file server at anytime. I can't save or load a file from disk. That's part of the challange. The data comes from Asterank which currently holds over 800.000 asteroids. I am also planning on generating textures based on absolute magnitude and spectral types if I can get the mesh done.

The bigger picture is that I am working on a web application which allows a user to select an asteroid from a queryable list powered by Asterank and automatically check with NASA's trajectory Browser if there is a mission for this asteroid. If there is a mission, for all XR vessels types a corresponding flight- and cargo plan is pre-loaded with all delta-v, fuel and LOX calculations done with the correct processing of all settings like ISP, APUburnrates etc. The plan can be further fine-tuned after which the user finally downloads the scenario. Then a zip file is generated, in the typical Orbiter add-on structure, containing all the files like the .scn, .xrcfg, mesh etc.
 

Majid

Active member
Joined
Oct 31, 2014
Messages
156
Reaction score
27
Points
43
I mean I don't see any visual data on Asterank so if you want to support all objects in their database, won't you be guessing on the visuals? Surely they don't know how all 600k of the objects in the database look like?

If you're going to be guessing the visuals then I'd just premake some asteroid meshes representing the different types. Then you can select from the premade meshes one to use. You can use animations in game to arbitrarily scale the mesh to different sizes for instance. And Orbiter API has some other ways to transform the mesh/textures in game. So you'll need to write like a vessel dll module to support that.

Also I haven't worked with Google App Engine in a long time but I think you'll need some storage to be able to prepare the zips for serving.
 

Marijn

Active member
Joined
Mar 5, 2008
Messages
755
Reaction score
166
Points
43
Location
Amsterdam
won't you be guessing on the visuals? Surely they don't know how all 600k of the objects in the database look like?

We hardly know what any asteroid looks like. So the plan is to use the few things we do know to script an 'artist impression'. There is a diameter, an est_diameter, albedo and spectral type in the Asterank API. The NASA trajectory browser also gives absolute magnitude. I think that's enough to create a simple asteroid representation. I'll use random numbers to fill in any blanks.

So you'll need to write like a vessel dll module to support that
That's beyond my skills at this moment. That's plan B for now.

you'll need some storage to be able to prepare the zips for serving.
Actually, I am already using my Gmail account for storing cache files. So I can store any files. But I want to avoid that as much as possible.
 
Top