## How to create a dragon in FlightGear?

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

### Re: How to create a dragon in FlightGear?

I did consider adding an optional constant external force for some sort of beginners mode.

Erik
erik

Posts: 1523
Joined: Thu Nov 01, 2007 1:41 pm

### Re: How to create a dragon in FlightGear?

Though we don't currently model the segmental motion or the forearm twist.

We actually do now (a segmental motion, not the twist).
Thorsten

Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am

### Re: How to create a dragon in FlightGear?

Bomber wrote in Mon Nov 16, 2015 2:33 pm:p.s. I'm a big dragon fan and have read many books on these creatures.

Then you'd know that the FDM would be a cross between that of a bird (or bat) and a hydrogen filled blimp

Regards,
Edward
bugman
Moderator

Posts: 1726
Joined: Thu Mar 19, 2015 9:01 am
Version: next

### Re: How to create a dragon in FlightGear?

Should we try some phase-shift function for the different length of up and downstroke? I guess I'd like that to be part of the FDM if possible rather than just a visual effect, but I don't know whether it complicates flight too much.
Thorsten

Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am

### Re: How to create a dragon in FlightGear?

I'm not sure I fully understand your question. Isn't that what the nested sine function does?

Erik
erik

Posts: 1523
Joined: Thu Nov 01, 2007 1:41 pm

### Re: How to create a dragon in FlightGear?

Thorsten wrote in Mon Nov 16, 2015 2:54 pm:
Though we don't currently model the segmental motion or the forearm twist.

We actually do now (a segmental motion, not the twist).

Cool! I missed that change. I'll look into the code to see how we can implement more of the joints via the angles in Table 1 of the paper. The current angles for the first segment would be the u1d (down) and u1u (up) angles in that table. So that you have a trig interpolation (the g1 function) between the two end points. I wonder how we can get this into \$FGDATA/Shaders/model-ALS-wingflex-organic.vert? The dihedral angle current range seems a little restricted. I'm also wondering if contacting Wu and Popovic would be a good idea, to see if they have a tables of actual numbers matching table 1 to have an idea of what could be used here, if all the arm joints could eventually be modelled.

Regards,
Edward
bugman
Moderator

Posts: 1726
Joined: Thu Mar 19, 2015 9:01 am
Version: next

### Re: How to create a dragon in FlightGear?

@Thorsten: By the way, the current hyperbolic function in the wingflexer is a little strange in that there are wing stretching effects going on, slightly increasing the wing length. It's hard to see the length change, but I get the impression that the visual effect is non-natural. It's quite obvious if you increase the gain on wing-alpha-scaled-deg. I though you mentioned that this flexing was via a trig function?

Regards,
Edward

Edit: Also, why is the alpha value set to 20 times the trig function cos(x + 0.25*cos(x)) in the fcs_function, and then the gain set to 0.025 so the final function in the shader is 0.5*cos(x + 0.25*cos(x))?
bugman
Moderator

Posts: 1726
Joined: Thu Mar 19, 2015 9:01 am
Version: next

### Re: How to create a dragon in FlightGear?

The multiply by 20 is needed for the FDM itself.

Erik
erik

Posts: 1523
Joined: Thu Nov 01, 2007 1:41 pm

### Re: How to create a dragon in FlightGear?

For a little more fun, try making these hacks:

1. In Systems/Wing Motion.xml, change the value of Wing Flap Frequency Control from 3.33 to 20. (Perhaps this needn't be a linear response to throttle position, since birds don't vary the wingbeat frequency to change speed so much as the beat depth, angle of attack, and force.)

2. In Engines/dummy.xml, change power unit="WATTS" from 0 to 400. Now we're talkin'!

This can result in an unfortunate nose-down pitch angle, but the beast behaves a lot more like a proper, evil-tempered dragon. A little more power would allow Immelmanns, but it's too easy to exceed the stability envelope.

Also, I noticed ground handling is somewhat amenable to differential braking. Landing is fairly easy into the wind, by tapping the "w" key to descend to the ground. Crosswind landings are invitations to disaster at my present skill level--I can land OK, but the dragon tips over and spins itself into a crash. I don't know if it was intentional, but the best level speed is made with full throttle and folded wings.

Golly, I'm having an unreasonably good time with this. Thanks!

someguy

Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

### Re: How to create a dragon in FlightGear?

I'm not sure I fully understand your question. Isn't that what the nested sine function does?

Yes, sorry - I plotted the wrong thing 20.0 * cos(x + 0.25*cos(0.75*x)), but you're not actually using the 0.75 in the code.

For the record, some other variants resembling the plots in the Wu/Popov paper that might be tried (with x clamped to [0:2pi]

x -> x * (f + (1-f) * ((atan(x-3.1415) / 2.5252) + 0.5))

or

x -> x / (f + (1-f) * ((atan(x-3.1415) / 2.5252) + 0.5))

with f [0:1] a parameter regulating the distortion.

I though you mentioned that this flexing was via a trig function?

No, I didn't. Neither would this make much sense, you can't get a smooth mesh distortion with a rigid body rotation. It seems you want to animate this in a rather different way by many connected elements (like Wu/Popov), but you can do this the traditional way with a segmented model and animation tags, you don't need the shader for this (neither is it a particularly suitable tool for nested rotations).

By the way, the current hyperbolic function in the wingflexer is a little strange in that there are wing stretching effects going on, slightly increasing the wing length. (...) It's quite obvious if you increase the gain on wing-alpha-scaled-deg. I though you mentioned that this flexing was via a trig function?

It's a parabolic function ( a hyperbola is 1/x), like many things in rendering it's a trick valid in a certain regime, and you're not supposed to increase the gain to arbitrary numbers, plain and simple.

I have to say the basic wing motion visually works well enough for me, and I actually don't want this to be bird-like.
Thorsten

Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am

### Re: How to create a dragon in FlightGear?

Thorsten wrote in Tue Nov 17, 2015 7:29 am:
I'm not sure I fully understand your question. Isn't that what the nested sine function does?

Yes, sorry - I plotted the wrong thing 20.0 * cos(x + 0.25*cos(0.75*x)), but you're not actually using the 0.75 in the code.

I ditched that parameter because it caused wrong behavior over time (I had not yet implement the Wing Position Range Limiter so it went outside the [0:2pi] range).

For the record, some other variants resembling the plots in the Wu/Popov paper that might be tried (with x clamped to [0:2pi]

x -> x * (f + (1-f) * ((atan(x-3.1415) / 2.5252) + 0.5))

or

x -> x / (f + (1-f) * ((atan(x-3.1415) / 2.5252) + 0.5))

with f [0:1] a parameter regulating the distortion.

You are free to try it for the animation but have my doubts this will work for the FDM.
And yes, I think this should be done in "Systems/Wing Motion.xml then.

Erik
erik

Posts: 1523
Joined: Thu Nov 01, 2007 1:41 pm

### Re: How to create a dragon in FlightGear?

Erik and Thorsten, you might enjoy this National geographic special about pterosaurs:

The last 30 minutes includes an analysis of flight mechanics.

someguy

Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

### Re: How to create a dragon in FlightGear?

Someguy or someone would you mind sending me a copy of your dragon? The snapshot generator on Sourceforge isn't working for me and I don't have time to figure out the Sourceforge git process.

MIG29pilot

Posts: 1454
Joined: Tue May 19, 2015 4:03 pm
Location: 6 feet under Snow
Callsign: MIG29pilot
Version: 3.7nightly
OS: Windows 10

### Re: How to create a dragon in FlightGear?

Interesting find someguy, I watched it in one go and found somethings we did right and a few areas that we might want to improve at some point.

Erik
erik

Posts: 1523
Joined: Thu Nov 01, 2007 1:41 pm

### Re: How to create a dragon in FlightGear?

MIG29pilot wrote in Tue Nov 24, 2015 9:14 pm:Someguy or someone would you mind sending me a copy of your dragon?

Try this: https://github.com/FGMEMBERS/Pterosaur/ ... master.zip

someguy

Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

PreviousNext