Custom Dynamic Animated 3D object

    • Official Post

    What would you like to do with this?

    In theory this should be possible with the option.tmc (per aircraft repaint/option) that were added a while ago. But I haven't tested that myself. In theory this option can be bound to a aircraft repaint (you could copy the default one) and it enables you to load additional models when the aircraft is initialized.

    If you want to create a sort of knee-board, this should work. A map or chart rendering is probably not possible, other than what's already in the executable.

  • What would you like to do with this?

    In theory this should be possible with the option.tmc (per aircraft repaint/option) that were added a while ago. But I haven't tested that myself. In theory this option can be bound to a aircraft repaint (you could copy the default one) and it enables you to load additional models when the aircraft is initialized.

    If you want to create a sort of knee-board, this should work. A map or chart rendering is probably not possible, other than what's already in the executable.

    Hi Jan,

    thanks for answering,

    My goal is to add skeletal hands inside cockpit with leapmotion for example but only for visualization, not for interraction with the virtual cockpit.

    Regards,

    JP

    • Official Post

    Hm... we already have virtual hands visible for the usual hand controllers and I think it would create a conflict if we decide to add support for the leapmotion hands. This is not a aircraft specific feature and you would basically have to modify each aircraft and all of each aircraft's repaints to support this globally. And it would have to override the default aircraft files in order to work which is not ideal because after each small update on our side it could just wipe out these changes. And if we make an update to the options files you'd also have to change them... I'm afraid that's not going to work long term.

    At the moment there are only very few examples of the option.tmc being used for something other than repaints. This is not an official feature yet because the menu is not part of the sim yet. But the internal file structure and loading of the option.tmc is working. One example is the Learjet 45 which uses it to change the fuel unit for example but it's an independant option, not bound to a repaint.

    If I get time in the next couple of days or next weekend I can document the new option.tmc feature in our wiki.

    There is no example of the options.tmc combined with the use of the external dll since this is the first time this is requested.

    I guess the first step could be that you copy one aircraft, e.g. our default C172, to your user documents and then use the messages that the external dll sends to aerofly, physics inputs, physics outputs, graphics inputs and finally graphics transformations to animate the hands of the human model that is visible on the pilot seat when you switch to the copilot seat. If you get even one thing moving from your external dll via tmd over to the human animation then you can basically expect that the same concept works with the option.tmc.

  • Thnaks for you long answer,

    Yes of course if you decide to add support for the leapmotion, it could create some conflict. But do you think support this soon or one day ?

    My goal is to create a cockpit in hard having button/handle at the same place than in the virtual cockpit. so one modif for one plane is not a problem at all.

    To do that, I need to know in realtime where are my hands/fingers exactly. Leap motion or Z cam can help me to do that.

    I already did an interface between openvr and aerofly to catch/overload datas on the fly if needed. (I didn't find any option in the sim to hide virtual hand or to bypass vrcontroler interraction with the sim, so I did that). I could add some 3D/overlay by this way too, if I cannot do it via the standard aerofly sdk.

    Could you explain me which message I should send to modify the human body via the dll ?

    What will be the data update rate reachable in Hz ?

    Many Thanks

    • Official Post

    Hi,

    Well you can't directly talk to the human animation via dll but what you can do is send messages to the aircraft's physics simulation. These messages are being received all the time, e.g. by your joystick input or key presses, etc. From the aircraft's standpoint your dll is seen the same as a clickspot interaction with the mouse or the same as a button or key press or joystick movement.

    The tmd file of the aircraft in question will have to be modified (text editor) and you have to add a message receiver. These are called e.g. "input_lever", "input_switch", "input_control", etc. They keep the last value received from the player interaction and hold it for the physics simulation (e.g. target for the actuator, etc.). You then output that data to the graphics via "output" or "output_free" objects.

    Inside the DynamicObjects section add this:

    Code
                <[input_control][HandPosition][]
                    <[string8][Input][YourExternalDLLMessageNameHere]>
                    <[tmvector2d][Range][ -1.0 1.0 ]>
                    <[float64][Value][0.0]>
                >
                <[output_free][HandPositionOutput][]
                    <[string8][Input][HandPosition.Output]>
                >

    On the graphics side (above the human graphics) a graphics_input has to be added, along with a graphics transformation.

    Code
                <[graphics_input][HandPosition][]
                    <[string8][InputID][HandPosition.Output]>
                    <[float64][Scaling][0.1]>
                    <[float64][Offset][0.0]>
                >
                <[graphics_translation][HandRotation][]
                    <[string8][Input][HandPosition.Output]>
                    <[tmvector3d][Axis][ 1.0 -1.0 0.0 ]>
                >

    This creates a transformation matrix that can be used by the bone model of the human graphics.

    Inside the "Pose" of the human_graphics object you need to find the right bone to animate and just "give it" the input transform "HandRotation.Output".

    I've taken the C172 and just replaced the throttle hand animation with the "HandRotation" from above.

    Once you see the human model hand "do something" as you change your external dll message value then you have mastered the first step.

    I can assist you with any tmd questions along the way. But I haven't experimented with the external dll myself other than the example project with sends aileron and elevator signals, which is the same concept as what you are trying to do here. But I can't help you with "how do you get the data from leap motion into the external dll"

  • If I understand, all messages will be string based and parsed by the sim (with strstr or regexp), and it the will be only one float per message.

    if I have to send all hand's bones at 60 or 120Hz like this it will probably "suck" no ?

    Regards,

  • Hi Jan,

    Is it possible to modify plane definition to avoid any interaction between VR hand and vrcockpit devices even if hands are represented and animated by aerofly?

    My goal is to create the hardward cockpit with all harwre devices at the good place and use leapmotion/sdraw as handtracking and keep aerofly vrhand representation and animation but stopping all cockpit interraction.

    Hope I'm clear ;)

    Thanks in advance,

    Jean-Pierre

    Edited once, last by jpx (June 5, 2020 at 3:36 PM).