POV-Ray : Newsgroups : povray.binaries.images : A Jet Fighter : Re: A Jet Fighter Server Time
1 Aug 2024 04:12:33 EDT (-0400)
  Re: A Jet Fighter  
From: Reactor
Date: 17 Dec 2008 21:55:00
Message: <web.4949bae775f3a16547e8fc870@news.povray.org>
"Bridgeofstraws" <bri### [at] inboxcom> wrote:

> It looks like you are much further in to your project than I am.  I haven't even
> thought about control surface alignment or variable contrails.  I would love to
> know the equations for determining this stuff.  I may not have sufficient math
> background to understand it instantly but that would make animation of the
> plane look so much more realistic.
>

I am not planning on making it completely accurate so much as visually correct.
I simply rotated the various control surfaces into what I felt looked like a
reasonable minimum and maximum position, and made the macros from there.  The
macros I currently have are fairly simple - the one below rotates the control
surface in place about a local axis within the object.

// rotates pAngle degrees about an arbitrary
//  axis as defined by points p1 and p2:
#macro trans_rot(p1, p2, pAngle)
    #local p3 = (p2 - p1);
    transform{
        translate -p1
        Axis_Rotate_Trans(p3, pAngle)
        translate p1
    }
#end


This one is used to get the angle that will be supplied to trans_rot - the
position is user supplied from [-1,1], but the minimum and maximum angle is
defined for each object.

#macro ac_int_getAngle( fposition, minAngle, maxAngle )
    #local fposition = min( 1, fposition);
    #local fposition = max(-1, fposition);

    #if( fposition >= 0 )
        #local fangle = fposition * maxAngle;
    #else
        #local fangle = -fposition * minAngle;
    #end

    fangle
#end

The two above macros are called internally for positioning, the only thing the
user has to call are the "external" parts, which look like below:

union
{
    ac10_main_body()
    ac10_right_leadingSlat( 1 )
    ac10_left_leadingSlat ( 1 )
    ac10_right_flap( 1 )
    ac10_left_flap ( 1 )
    ac10_right_aileron( 1 )
    ac10_left_aileron ( 1 )
    ac10_right_horizStabilizer( 0, 0.75 )
    ac10_left_horizStabilizer ( 0, 0.75 )
    ac10_right_rudder( 1 )
    ac10_left_rudder ( 1 )
translate <0,5,0>
}

These macros place the all of the parts in their fully deployed position except
for the horizontal stabilizer's trim setting, which is neutral, and the
elevator, which is at 75% max.  I felt parametrizing was the best way to go so
I wouldn't have to remember the angles each part needed to be at.

I haven't done it yet, but I think I could use most of the existing spline_trans
macro, and move the control surfaces automagically based on the aircraft's
movement... the problem, of course, is that a high performance aircraft will
keep the orientation it is at when the controls are neutral.  That is, the
control surface position cannot be based on orientation only, since it would
not make sense for an aircraft that has rolled onto their side and maintained
sideways flight to still have the flaps in a position that would make the
aircraft continue to roll.
What that means, as far as I can tell, is that the position should be partially
based on the derivative of the orientation "curve," so to speak.  For instance,
when the aircraft is rolling hard, the flaps should be at their most extreme
position when the orientation rate of change is the highest and at the neutral
position when the orientation is no longer changing, regardless of what it is.

Unfortunately, my vector calculus isn't very good, otherwise, I would have
finished this already with an part that calculates instantaneous curvature,
which would allow one to place vapor trails (at pre-defined locations).

Of course, this is the hard way to do things.  The other way is to simply make
more splines that define the control surface positions at various parts of the
location/orientation spline, but... *sigh* there would just be something very
nice about having an aircraft model that positions its control surfaces
correctly in responds to its path and instantaneous velocity... you could even
make the exhaust flames longer when it moves at higher speed, or make it deploy
the flaps in level flight when it is at very low speed, or... wait, I should
finish the model first.


-Reactor

(First part of a multi-parter!)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.