Meshing Question Orbiter Scene Graph File to Replace DLL Requirement

TCR_500

Developer of Solar Lander
Joined
Mar 3, 2009
Messages
631
Reaction score
36
Points
28
Website
www.tchapman500.com
One thing that I noticed a while back was that some games have animations defined in files. These animations are either defined in the same file as the mesh, or in separate animation files. But for Orbiter, animations are defined in the DLL file along with several other things that other games define in mesh or scene definition files.

Here's a short list of things I've seen defined in binary or text files that need a DLL for Orbiter.
  • Mesh Grouping
  • LOD Switching
  • State-Based Mesh Switching
  • Light Sources
  • Animation Sequences
  • Animation Trees
  • Mesh Deformation (As Start and Target Meshes)
  • Object Transform
I'm thinking that the Orbiter API could be extended to load a scene graph file that includes all of the things a normal mesh file includes, plus the things listed above. And possibly be able to reference normal mesh files. So instead of each vessel DLL implementing animation trees, the vessel DLL loads a scene graph, then calls a function to start or stop an animation. Same applies for LOD switching or any other generic function for manipulating meshes/mesh visibility.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
9,846
Reaction score
681
Points
203
Location
between the planets
The main issue here is feature support. Compared to modern game engines, Orbiters animation support is extremely bare bones, and only a small subset of it could actually be supported at this time.
In order to provide scenegraph support, you'll have to implement most of the things on your list from scratch. Also, you'd do that in the graphics client, not in the core itself...

It can be done, sure, but that's a huge amount of work we're talking about here...

As for just outsourcing animation definitions to a file, that has been done multiple times in different ways by different add-ons, but none of them have ever been standardised and been adopted into the core. Now that orbiter is open source, something like this could certainly be done to extend the vessel configs. But IMHO they'd have to be for orbiters native capability, if you're starting with something as insanely complex as a modern scene graph you'll set yourself up for failure.
 

TCR_500

Developer of Solar Lander
Joined
Mar 3, 2009
Messages
631
Reaction score
36
Points
28
Website
www.tchapman500.com
Over the past couple of weeks, I've been reverse-engineering a scene graph file from a racing simulator so that my track editor for that simulator will be able to read the scene graph and properly display the object. So I have a good idea of how to structure a scene graph (I obviously won't make it binary-compatible with the one I reverse-engineered). I'll work on a standardized file structure to propose.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
9,846
Reaction score
681
Points
203
Location
between the planets
Unless you plan to write a client, you don't have DX11 in orbiter. Now, I'm not very familiar with the tooling, but I'd guess that DX11 provides a lot of features for that kind of thing out of the box that DX9 doesn't...
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,314
Reaction score
435
Points
123
Location
Vienna
Defining vessel specific animations and the like in a specific format file suspiciously sounds like yet another Spacecraft/Multistage/GenericVehicle system.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
9,846
Reaction score
681
Points
203
Location
between the planets
Defining vessel specific animations and the like in a specific format file suspiciously sounds like yet another Spacecraft/Multistage/GenericVehicle system.

It totally sounds like that, except... if something like animation definitions and light source placement could be based on an industry standard that modeling programs support and can export to more or less out of the box, and would have core support or at least be a static lib you could pull into your own project so you're not tied to a plugin, that would be very useful...
 

DaveS

Space Shuttle Ultra Project co-developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,158
Reaction score
421
Points
173
It totally sounds like that, except... if something like animation definitions and light source placement could be based on an industry standard that modeling programs support and can export to more or less out of the box, and would have core support or at least be a static lib you could pull into your own project so you're not tied to a plugin, that would be very useful...
Before it went of the rails, something similar was in the works for SSU, moving all of the animation stuff out of the modules and into dedicated files. So it has bit of history.
 

TCR_500

Developer of Solar Lander
Joined
Mar 3, 2009
Messages
631
Reaction score
36
Points
28
Website
www.tchapman500.com
I think I got something. I made a structure definition file that is designed to be used with HEX Workshop for use with binary files. But I'm sure it can be adapted to a text file if needed. I find it easier to make readers/writers for binary files though. Also, note that this format expresses rotations as quaternions instead of Euler angles.

Also, concerning where this would be implemented. It would be best to implement this in the core, so that the core decides which meshes to send to the graphics client.
 

Attachments

  • OrbiterSceneGraph.zip
    1.6 KB · Views: 0

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,146
Reaction score
9
Points
53
It totally sounds like that, except... if something like animation definitions and light source placement could be based on an industry standard that modeling programs support and can export to more or less out of the box, and would have core support or at least be a static lib you could pull into your own project so you're not tied to a plugin, that would be very useful...
The only thing close to an industry standard I'm aware of is .fbx. There's been several attempts of course but AFAIK .fbx is the only one that's got widespread support. The problem there of course is it's a proprietary closed source format.
 

TCR_500

Developer of Solar Lander
Joined
Mar 3, 2009
Messages
631
Reaction score
36
Points
28
Website
www.tchapman500.com
A few days ago, I looked at the API documentation for Orbiter 2016 and I found that a mesh can be created from a scene graph by calling oapiCreateMesh() and then modifying the visibility flags of individual mesh groups. For transform hierarchies, it looks like we'll need to use animation components with the animation state set to 1. But that'll only work on vessels. There's also the option of manually transforming every vertex of each meshgroup in the hierarchy to set the initial position of the mesh. But that may introduce noticeable floating point errors.
 
Top