!S9Font.f95          Group ID: #9     Stereo-3D Simulation Environment Vsn:1.00
!2025.05.24.1840cdt- 3D text.

!            Author- Jeffrey M. Setterholm, Lakeville,MN 55044 USA
!         IP Status- Free source code (e.g.: post copyright)
!
!          Computer- "T3"/Dell Precision T3500/Intel i5 E5520/Win10Pro-21H2
!                     ^name ^Mfgr.Id           ^chipset       ^OS 
!                    /Absoft Pro Fortran 21.0.2/GeForce GTX 1050/f90gl~Glut3.7
!                     ^compiler ~Fortran 95     ^graphics card   ^graphics

!    f90gl bindings- public domain; see "https://math.nist.gov/f90gl/"

!Disclaimer:
! ***************************************************************
! **********   Individual cognition is always flawed,  **********
! **********         including yours and mine.         **********
! **********                 - So: -                   **********
! **********       Use this code at your own risk.     **********
! ***************************************************************

!Table of Contents: ...use to search...
!Module CharDef
!  ~an English character vector font, & more.
!End Module CharDef
!Subroutine AlphaJS(cLabelL,PosLLCq,RpyDq,SizeHq,iCol,fLineWidth,iP)
!Subroutine Model7DoF(Xyzh,Rpyh,S,Model7h,iP)

!---------------------------------------------------------------------------7-9

Module CharDef
!2018.08.16.2120cdt JMS- Transferred the C implementation to Fortran.
!2018.07.17.        JMS- Grid coordinates defining characters are now square.
!                        vertical & horizontal lines can have the same width.
!2018.04.11.1400cdt JMS- Enlarged the Free symbol char(224)
!                      - The identical character data is found in:
!                          http://ftp.setterholm.com/3DEnvC in file 3DVecText.h
!                      - Traveler2/Athlon64/WinXPPro-32/APF9.0-32
!use CharDef                                                        !2018.03.21
 implicit none
 !---

 !ASCII character starting locations in CharLoc (if >0) :
 integer(2),public:: CharLoc(0:255) = (/                                        &
! 0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f
!                                  BEL   BS   HT   LF   VT   FF   CR          0
   0,   0,   0,   0,   0,   0,   0,   1,  67, 136, 169, 196, 220, 253,   0,   0,&
!                                                      ESC                    1
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 307,   0,   0,   0,   0,&
!     !    "    #    $    %    &    '    (    )    *    +    ,    -    .    / 2
 385, 388, 412, 427, 454, 505, 568, 634, 643, 670, 697, 718, 733, 754, 763, 781,&
! 0   1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ? 3
 790, 838, 856, 889, 931, 946, 979,1018,1030,1081,1120,1153,1180,1192,1207,1219,&
! @   A    B    C    D    E    F    G    H    I    J    K    L    M    N    O 4
1276,1336,1354,1393,1426,1450,1471,1489,1522,1543,1564,1585,1609,1621,1639,1654,&
! P   Q    R    S    T    U    V    W    X    Y    Z    [    \    ]    ^    _ 5
1684,1708,1744,1777,1822,1837,1858,1870,1888,1903,1921,1936,1951,1960,1975,1987,&
! `   a    b    c    d    e    f    g    h    i    j    k    l    m    n    o 6
1996,2005,2038,2071,2098,2131,2164,2188,2224,2248,2272,2305,2326,2338,2377,2401,&
! p   q    r    s    t    u    v    w    x    y    z    {    |    }    ~     7
2431,2464,2506,2527,2566,2581,2605,2617,2635,2650,2683,2698,2734,2743,2779,2812,&
!                                                                             8
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,&
!                         •  box  grid        ™                               9
   0,   0,   0,   0,   0,2860,   0,   0,   0,2884,   0,   0,   0,   0,   0,   0,&
!                                             ©                        ®      a
   0,   0,   0,   0,   0,   0,   0,   0,   0,2938,   0,   0,   0,   0,2992,   0,&
! °   ±                                                                       b
3049,3091,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,&
!Special use in CEnv3D- Colors (black screen  background):
!mov Wht lRed  Red  Mag  Yel lGrn  Grn  Cyn lBlu  Blu LGry  Gry  Brn  Prp Blk c
3112,3184,3238,3316,3385,3448,3493,3574,3646,3700,3775,3841,3925,4000,4078,4150,&
!Special use in CEnv3D- Shape modifiers:
!toff w1.  w2.  w3.  w4.  w5. ita  und  sub  sup                show          d
4219,4300,4327,4369,4414,4447,4486,4534,4588,4675,   0,   0,   0,4747,   0,   0,&
!Free ©    ®    ™   ©x                                               box  gride
4831,4906,4960,5017,5071,   0,   0,   0,   0,   0,   0,   0,   0,   0,5122,5140,&
!                                                                             f
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0/)
! 0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f
!CharLoc(256) defined above.

 integer(2),public:: PointLoc(5199)    !8 triples-per-line.
        data PointLoc(   1: 600) / &  !~ASCII characters   7- 38 decimal
0,  7, 21,1,-20, 30,2,-10, 30,2, -8, 27,2, -8, 21,2,-12, 18,2,-20, 18,1,-12, 18,&
2, -8, 15,2, -8,  9,2,-10,  6,2,-20,  6,2,-20, 30,1,  6, 12,2, -6, 12,2, -6,-12,&
2,  6,-12,1, -6,  0,2,  2,  0,1,  8, -6,2,  8,-30,2, 20,-30,0,  8, 22,1,-16, 24,&
2, -6, 24,2, -2, 21,2, -2, 15,2, -8, 12,2,-16, 12,1, -8, 12,2, -2,  9,2, -2,  3,&
2, -6,  0,2,-16,  0,2,-16, 24,1, 16, -3,2, 12,  0,2,  6,  0,2,  2, -3,2,  2, -9,&
2, 16,-15,2, 16,-21,2, 12,-24,2,  6,-24,2,  2,-21,0,  9, 10,1,-16, 24,2,-16,  0,&
1,-16, 12,2, -2, 12,1, -2, 24,2, -2,  0,1,  2,  0,2, 18,  0,1, 10,  0,2, 10,-24,&
0, 10,  8,1,-16, 24,2,-16,  0,2, -2,  0,1,  2,-24,2,  2,  0,2, 16,  0,1,  2,-12,&
2, 14,-12,0, 11,  7,1,-16, 24,2, -8,  0,2, -2, 24,1,  2,  0,2, 18,  0,1, 10,  0,&
2, 10,-24,0, 12, 10,1,-16,  0,2,-16, 24,2, -2, 24,1,-16, 12,2, -4, 12,1,  2,-24,&
2,  2,  0,2, 16,  0,1,  2,-12,2, 14,-12,0, 13, 17,1, -2, 18,2, -6, 24,2,-12, 24,&
2,-16, 18,2,-16,  6,2,-12,  0,2, -6,  0,2, -2,  6,1,  2,-24,2,  2,  0,2, 12,  0,&
2, 16, -3,2, 16, -9,2, 12,-12,2,  2,-12,1,  8,-12,2, 16,-24,0, 27, 25,1, -8, 30,&
2,-20, 30,2,-20,  6,2, -8,  6,1,-20, 18,2,-12, 18,1,  6,  9,2,  4, 12,2, -4, 12,&
2, -6,  9,2, -6,  3,2,  6, -3,2,  6, -9,2,  4,-12,2, -4,-12,2, -6, -9,1, 20, -9,&
1, 20,-12,2, 16, -6,2, 12, -6,2,  8,-12,2,  8,-24,2, 12,-30,2, 16,-30,2, 20,-24,&
0, 32,  0,0, 33,  7,1,  0, 30,2,  0,-18,1,  0,-27,2,  2,-30,2,  0,-33,2, -2,-30,&
2,  0,-27,0, 34,  4,1, -8, 30,2, -8, 15,1,  8, 30,2,  8, 15,0, 35,  8,1, -8, 18,&
2,-14,-24,1, 12, 18,2,  6,-24,1,-16,  6,2, 16,  6,1,-18,-12,2, 14,-12,0, 36, 16,&
1, 14, 12,2,  6, 21,2, -6, 21,2,-14, 12,2,-14,  9,2, -6,  0,2,  6,  0,2, 14, -9,&
2, 14,-12,2,  6,-21,2, -6,-21,2,-14,-12,1, -4, 27,2, -4,-27,1,  4, 27,2,  4,-27,&
0, 37, 20,1,-10, 30,2, -6, 27,2, -6, 18,2,-10, 15,2,-16, 15,2,-20, 18,2,-20, 27,&
2,-16, 30,2,-10, 30,1, 20, 30,2,-20,-30,1, 10,-15,2, 16,-15,2, 20,-18,2, 20,-27,&
2, 16,-30,2, 10,-30,2,  6,-27,2,  6,-18,2, 10,-15,0, 38, 21,1, 20,-30,2,-12,  9,&
2,-14, 15,2,-14, 18,2,-10, 27,2, -4, 30,2,  2, 30,2,  8, 27,2, 12, 18,2, 12, 15 &
                                                                               /
        data PointLoc( 601:1200) / &  !~ASCII characters  39- 61
2,  8,  9,2,-12, -6,2,-18, -9,2,-20,-15,2,-20,-18,2,-18,-24,2,-14,-27,2, -6,-30,&
2,  6,-30,2, 10,-27,2, 20,-15,0, 39,  2,1,  0, 30,2,  0, 15,0, 40,  8,1,  6, 30,&
2,  0, 27,2, -4, 18,2, -6,  6,2, -6, -6,2, -4,-18,2,  0,-27,2,  6,-30,0, 41,  8,&
1, -6, 30,2,  0, 27,2,  4, 18,2,  6,  6,2,  6, -6,2,  4,-18,2,  0,-27,2, -6,-30,&
0, 42,  6,1, 10, 24,2,-10,-24,1, 20,  0,2,-20,  0,1, 10,-24,2,-10, 24,0, 43,  4,&
1,  0, 18,2,  0,-18,1, 20,  0,2,-20,  0,0, 44,  6,1,  2,-33,2, -2,-33,2, -2,-30,&
2,  2,-30,2,  2,-36,2, -2,-45,0, 45,  2,1,-20,  0,2, 20,  0,0, 46,  5,1,  0,-27,&
2,  2,-30,2,  0,-33,2, -2,-30,2,  0,-27,0, 47,  2,1,-20,-30,2, 20, 30,0, 48, 15,&
1,  0,-30,2,-10,-30,2,-20,-15,2,-20,  0,2,-20, 15,2,-10, 30,2,  0, 30,2, 10, 30,&
2, 20, 15,2, 20,  0,2, 20,-15,2, 10,-30,2,  0,-30,1,-20,-30,2, 20, 30,0, 49,  5,&
1,-10,  6,2,  0, 30,2,  0,-30,1,-10,-30,2, 10,-30,0, 50, 10,1,-20, 18,2,-12, 24,&
2,  0, 30,2, 12, 24,2, 20, 15,2, 12,  6,2,  0,  0,2,-12, -6,2,-20,-30,2, 20,-30,&
0, 51, 13,1,-20, 18,2,-12, 30,2, 12, 30,2, 20, 18,2, 20,  6,2, 12,  0,2, -4,  0,&
2, 12,  0,2, 20, -6,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,0, 52,  4,1, 20, -9,&
2,-20, -9,2, 12, 30,2, 12,-30,0, 53, 10,1, 20, 30,2,-20, 30,2,-20,  0,2,-12,  6,&
2, 12,  6,2, 20,  0,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,0, 54, 12,1, 20, 18,&
2, 12, 30,2,-12, 30,2,-20, 18,2,-20,-18,2,-12,-30,2, 12,-30,2, 20,-18,2, 20, -6,&
2, 12,  0,2,-12,  0,2,-20, -6,0, 55,  3,1,-20, 30,2, 20, 30,2, -6,-30,0, 56, 16,&
1,-12,  0,2,-20,  6,2,-20, 18,2,-12, 30,2, 12, 30,2, 20, 18,2, 20,  6,2, 12,  0,&
2,-12,  0,2,-20, -6,2,-20,-18,2,-12,-30,2, 12,-30,2, 20,-18,2, 20, -6,2, 12,  0,&
0, 57, 12,1, 20,  6,2, 12,  0,2,-12,  0,2,-20,  6,2,-20, 18,2,-12, 30,2, 12, 30,&
2, 20, 18,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,0, 58, 10,1,  0,  3,2,  2,  0,&
2,  0, -3,2, -2,  0,2,  0,  3,1,  0,-24,2,  2,-27,2,  0,-30,2, -2,-27,2,  0,-24,&
0, 59,  8,1,  0,-12,2,  2,-15,2,  0,-18,2, -2,-15,2,  0,-12,1,  0,-27,2,  0,-33,&
2, -4,-39,0, 60,  3,1, 20, 15,2,-20,  0,2, 20,-15,0, 61,  4,1,-18,  6,2, 18,  6 &
                                                                               /
        data PointLoc(1201:1800) / &  !~ASCII characters  62- 83
1,-18, -6,2, 18, -6,0, 62,  3,1,-20, 15,2, 20,  0,2,-20,-15,0, 63, 18,1,-20, 18,&
2,-18, 24,2,-14, 27,2, -6, 30,2,  6, 30,2, 14, 27,2, 18, 24,2, 20, 18,2, 20, 12,&
2, 18,  6,2, 14,  3,2,  0, -3,2,  0,-15,1,  0,-27,2,  2,-30,2,  0,-33,2, -2,-30,&
2,  0,-27,0, 64, 19,1,  8,  6,2,  4,  9,2, -2,  9,2, -8,  3,2, -8, -6,2, -2,-12,&
2,  4,-12,2,  8, -9,2,  8,  9,1,  8, -9,2, 12,-12,2, 20, -9,2, 20,  9,2, 10, 18,&
2,-10, 18,2,-20,  9,2,-20, -9,2,-10,-18,2, 10,-18,0, 65,  5,1,-20,-30,2,  0, 30,&
2, 20,-30,1,-12, -9,2, 12, -9,0, 66, 12,1,-20, 30,2, 12, 30,2, 20, 18,2, 20,  6,&
2, 12,  0,2,-20,  0,1, 12,  0,2, 20, -6,2, 20,-18,2, 12,-30,2,-20,-30,2,-20, 30,&
0, 67, 10,1, 20, 18,2, 20, 18,2, 12, 30,2,-12, 30,2,-20, 18,2,-20,-18,2,-12,-30,&
2, 12,-30,2, 20,-18,2, 20,-18,0, 68,  7,1,-20, 30,2, 12, 30,2, 20, 18,2, 20,-18,&
2, 12,-30,2,-20,-30,2,-20, 30,0, 69,  6,1,-20,  0,2, 12,  0,1, 20, 30,2,-20, 30,&
2,-20,-30,2, 20,-30,0, 70,  5,1,-20,  0,2, 12,  0,1, 20, 30,2,-20, 30,2,-20,-30,&
0, 71, 10,1,  0,  0,2, 20,  0,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,2,-20, 18,&
2,-12, 30,2, 12, 30,2, 20, 18,0, 72,  6,1,-20, 30,2,-20,-30,1,-20,  0,2, 20,  0,&
1, 20, 30,2, 20,-30,0, 73,  6,1,-10, 30,2, 10, 30,1,  0, 30,2,  0,-30,1,-10,-30,&
2, 10,-30,0, 74,  6,1, 20, 30,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,2,-20, -9,&
0, 75,  7,1,-20, 30,2,-20,-30,1,-20,  0,2,  0,  0,2, 20, 30,1,  0,  0,2, 20,-30,&
0, 76,  3,1,-20, 30,2,-20,-30,2, 20,-30,0, 77,  5,1,-20,-30,2,-20, 30,2,  0, -9,&
2, 20, 30,2, 20,-30,0, 78,  4,1,-20,-30,2,-20, 30,2, 20,-30,2, 20, 30,0, 79,  9,&
1, 12, 30,2, 20, 18,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,2,-20, 18,2,-12, 30,&
2, 12, 30,0, 80,  7,1,-20,-30,2,-20, 30,2, 12, 30,2, 20, 18,2, 20,  9,2, 12,  0,&
2,-20,  0,0, 81, 11,1, 12, 30,2, 20, 18,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,&
2,-20, 18,2,-12, 30,2, 12, 30,1,  0,  0,2, 24,-36,0, 82, 10,1,-20,-30,2,-20, 30,&
2, 12, 30,2, 20, 18,2, 20,  9,2, 12,  0,2,-20,  0,1, 10,  0,2, 20,-15,2, 20,-30,&
0, 83, 14,1, 20, 18,2, 20, 18,2, 12, 30,2,-12, 30,2,-20, 18,2,-20,  6,2,-12,  0 &
                                                                               /
        data PointLoc(1801:2400) / &  !~ASCII characters  84-110
2, 12,  0,2, 20, -6,2, 20,-18,2, 12,-30,2,-12,-30,2,-20,-18,2,-20,-18,0, 84,  4,&
1,-20, 30,2, 20, 30,1,  0, 30,2,  0,-30,0, 85,  6,1,-20, 30,2,-20,-18,2,-12,-30,&
2, 12,-30,2, 20,-18,2, 20, 30,0, 86,  3,1,-20, 30,2,  0,-30,2, 20, 30,0, 87,  5,&
1,-20, 30,2,-10,-30,2,  0, 15,2, 10,-30,2, 20, 30,0, 88,  4,1,-20, 30,2, 20,-30,&
1,-20,-30,2, 20, 30,0, 89,  5,1,-20, 30,2,  0,  0,2,  0,-30,1,  0,  0,2, 20, 30,&
0, 90,  4,1,-20, 30,2, 20, 30,2,-20,-30,2, 20,-30,0, 91,  4,1,  6, 30,2, -6, 30,&
2, -6,-30,2,  6,-30,0, 92,  2,1,-20, 30,2, 20,-30,0, 93,  4,1, -6, 30,2,  6, 30,&
2,  6,-30,2, -6,-30,0, 94,  3,1,-16,  0,2,  0, 18,2, 16,  0,0, 95,  2,1,-20,-33,&
2, 20,-33,0, 96,  2,1, -6, 30,2,  0, 15,0, 97, 10,1, 18,  0,2, 18,-21,2,  8,-30,&
2, -8,-30,2,-18,-21,2,-18, -9,2, -8,  0,2,  8,  0,2, 18, -9,2, 18,-30,0, 98, 10,&
1,-18, 24,2,-18,-21,2, -8,-30,2,  8,-30,2, 18,-21,2, 18, -9,2,  8,  0,2, -6,  0,&
2,-18, -9,2,-18,-30,0, 99,  8,1, 18, -9,2,  8,  0,2, -8,  0,2,-18, -9,2,-18,-21,&
2, -8,-30,2,  8,-30,2, 18,-21,0,100, 10,1, 18, 24,2, 18,-21,2,  8,-30,2, -8,-30,&
2,-18,-21,2,-18, -9,2, -8,  0,2,  8,  0,2, 18, -9,2, 18,-30,0,101, 10,1,-18,-15,&
2, 18,-15,2, 18, -9,2,  8,  0,2, -8,  0,2,-18, -9,2,-18,-21,2, -8,-30,2,  8,-30,&
2, 18,-27,0,102,  7,1,-10,-30,2,-10, 18,2,  0, 24,2,  8, 24,2, 18, 18,1,-18,  0,&
2, 18,  0,0,103, 11,1, 18,-21,2,  8,-30,2, -8,-30,2,-18,-21,2,-18, -9,2, -8,  0,&
2,  8,  0,2, 18, -9,2, 18,-36,2,  8,-45,2, -8,-45,0,104,  7,1,-18, 24,2,-18,-30,&
2,-18, -9,2, -8,  0,2,  8,  0,2, 18, -9,2, 18,-30,0,105,  7,1,  0,  0,2,  0,-30,&
1,  0, 21,2,  2, 18,2,  0, 15,2, -2, 18,2,  0, 21,0,106, 10,1, 18,  0,2, 18,-36,&
2,  8,-45,2, -8,-45,2,-18,-36,1, 18, 21,2, 20, 18,2, 18, 15,2, 16, 18,2, 18, 21,&
0,107,  6,1,-18, 24,2,-18,-30,1,-18, -6,2, 10, 12,1,-14, -3,2, 18,-30,0,108,  3,&
1,  0, 24,2,  0,-30,2,  4,-30,0,109, 12,1,-18,-30,2,-18,  0,1,-18, -9,2,-12,  0,&
2, -6,  0,2,  0, -9,2,  0,-24,1,  0, -9,2,  6,  0,2, 12,  0,2, 18, -9,2, 18,-30,&
0,110,  7,1,-18,-30,2,-18,  0,1,-18, -9,2, -8,  0,2,  8,  0,2, 18, -9,2, 18,-30 &
                                                                               /
        data PointLoc(2401:3000) / &  !~ASCII characters 111-174
0,111,  9,1,  8,  0,2, 18, -9,2, 18,-21,2,  8,-30,2, -8,-30,2,-18,-21,2,-18, -9,&
2, -8,  0,2,  8,  0,0,112, 10,1,-18,-45,2,-18,  0,1,-18, -9,2, -8,  0,2,  8,  0,&
2, 18, -9,2, 18,-21,2,  8,-30,2, -8,-30,2,-18,-21,0,113, 13,1, 18,-21,2,  8,-30,&
2, -8,-30,2,-18,-21,2,-18, -9,2, -8,  0,2,  8,  0,2, 18, -9,2, 18,-21,2, 12,-42,&
2, 14,-45,2, 18,-45,2, 20,-42,0,114,  6,1,-18,-30,2,-18,  0,1,-18, -9,2, -8,  0,&
2,  8,  0,2, 20, -9,0,115, 12,1, 18, -6,2,  8,  0,2, -8,  0,2,-18, -6,2,-18, -9,&
2, -8,-15,2,  8,-15,2, 18,-21,2, 18,-24,2,  8,-30,2, -8,-30,2,-18,-24,0,116,  4,&
1,  0, 24,2,  0,-30,1,-18, 12,2, 18, 12,0,117,  7,1,-18,  0,2,-18,-21,2, -8,-30,&
2,  8,-30,2, 18,-21,2, 18,  0,2, 18,-30,0,118,  3,1,-18,  0,2,  0,-30,2, 18,  0,&
0,119,  5,1,-18,  0,2, -8,-30,2,  0, -6,2,  8,-30,2, 18,  0,0,120,  4,1,-18,  0,&
2, 18,-30,1,-18,-30,2, 18,  0,0,121, 10,1,-18,  0,2,-18,-21,2,-10,-30,2,  8,-30,&
2, 18,-21,1, 18,  0,2, 18,-36,2,  8,-45,2,-10,-45,2,-18,-42,0,122,  4,1,-18,  0,&
2, 18,  0,2,-18,-30,2, 18,-30,0,123, 11,1,  6, 30,2,  0, 27,2, -2, 21,2,  0,  9,&
2, -2,  3,2, -6,  0,2, -2, -3,2,  0, -9,2, -2,-21,2,  0,-27,2,  6,-30,0,124,  2,&
1,  0, 30,2,  0,-30,0,125, 11,1, -6, 30,2,  0, 27,2,  2, 21,2,  0,  9,2,  2,  3,&
2,  6,  0,2,  2, -3,2,  0, -9,2,  2,-21,2,  0,-27,2, -6,-30,0,126, 10,1,-20, -3,&
2,-18,  3,2,-12,  6,2, -8,  6,2, -2,  3,2,  2, -3,2,  8, -6,2, 12, -6,2, 18, -3,&
2, 20,  3,0,127, 15,1,-14,-30,2,-14,-12,2,-16,-15,1, -6,-15,2, -2,-12,2,  2,-12,&
2,  6,-15,2,  6,-21,2,  2,-24,2, -4,-24,2, -6,-30,2,  6,-30,1,  8,-12,2, 20,-12,&
2, 14,-30,0,149,  7,1,  2,  3,2,  4,  0,2,  2, -3,2, -2, -3,2, -4,  0,2, -2,  3,&
2,  2,  3,0,153, 17,1,-18, 24,2,-18, 27,2, -2, 27,2, -2, 24,1,-10, 27,2,-10,  3,&
1,-12,  3,2, -8,  3,1,  0,  3,2,  4,  3,1,  2,  3,2,  2, 27,2, 10, 15,2, 18, 27,&
2, 18,  3,1, 16,  3,2, 20,  3,0,169, 17,1, 10, 21,2, 20, 12,2, 20,-12,2, 10,-21,&
2,-10,-21,2,-20,-12,2,-20, 12,2,-10, 21,2, 10, 21,1, 12,  6,2,  6, 12,2, -6, 12,&
2,-12,  6,2,-12, -6,2, -6,-12,2,  8,-12,2, 12, -6,0,174, 18,1, -8, -3,2, -8, 21 &
                                                                               /
        data PointLoc(3001:3600) / &  !~ASCII characters 176-199
2,  4, 21,2,  8, 18,2,  8, 12,2,  4,  9,2, -8,  9,1,  2,  9,2,  8, -3,1,  8, 30,&
2, 20, 21,2, 20, -3,2,  8,-12,2, -8,-12,2,-20, -3,2,-20, 21,2, -8, 30,2,  8, 30,&
0,176, 13,1,  2, 30,2,  6, 27,2,  8, 24,2,  8, 21,2,  6, 18,2,  2, 15,2, -2, 15,&
2, -6, 18,2, -8, 21,2, -8, 24,2, -6, 27,2, -2, 30,2,  2, 30,0,177,  6,1,-20,  0,&
2, 20,  0,1,  0, 15,2,  0,-15,1,-20,-18,2, 20,-18,0,192, 23,1,-20, 15,2,-20, 27,&
2,-16, 21,2,-12, 27,2,-12, 15,1, -4, 27,2, -2, 24,2, -2, 18,2, -4, 15,2, -6, 15,&
2, -8, 18,2, -8, 24,2, -6, 27,2, -4, 27,1,  2, 27,2,  6, 15,2, 10, 27,1, 20, 27,&
2, 14, 27,2, 14, 15,2, 20, 15,1, 14, 21,2, 20, 21,0,193, 17,1,-20, 24,2,-16,  6,&
2,-12, 24,2, -8,  6,2, -4, 24,1,  0, 24,2,  0,  6,1,  0, 15,2, 10, 15,1, 10, 24,&
2, 10,  6,1, 18, 24,2, 18,  6,1, 16, 24,2, 20, 24,1, 16,  6,2, 20,  6,0,194, 25,&
1,-20, 18,2,-20,  6,2,-16,  6,1,-14,  6,2,-14, 24,2, -6, 24,2, -4, 21,2, -4, 18,&
2, -6, 15,2,-14, 15,1,-10, 15,2, -4,  6,1,  8, 24,2,  0, 24,2,  0,  6,2,  8,  6,&
1,  0, 15,2,  6, 15,1, 12, 24,2, 18, 24,2, 20, 18,2, 20, 12,2, 18,  6,2, 12,  6,&
2, 12, 24,0,195, 22,1,-20,  6,2,-20, 24,2,-12, 24,2, -8, 21,2, -8, 18,2,-12, 15,&
2,-20, 15,1,-14, 15,2, -8,  6,1,  6, 24,2, -4, 24,2, -4,  6,2,  6,  6,1, -4, 15,&
2,  4, 15,1, 10, 24,2, 16, 24,2, 20, 18,2, 20, 12,2, 16,  6,2, 10,  6,2, 10, 24,&
0,196, 20,1,-20,  6,2,-20, 24,2,-14, 15,2, -8, 24,2, -8,  6,1, -4,  6,2,  0, 24,&
2,  4,  6,1, -2, 15,2,  2, 15,1, 20, 21,2, 16, 24,2, 12, 24,2,  8, 21,2,  8,  9,&
2, 12,  6,2, 16,  6,2, 20,  9,2, 20, 15,2, 14, 15,0,197, 14,1,-20, 24,2,-14, 15,&
2, -8, 24,1,-14, 15,2,-14,  6,1,  6, 24,2, -4, 24,2, -4,  6,2,  6,  6,1, -4, 15,&
2,  2, 15,1, 10, 24,2, 10,  6,2, 20,  6,0,198, 26,1,-20, 18,2,-20,  6,2,-16,  6,&
1, -4, 21,2, -8, 24,2,-10, 24,2,-14, 21,2,-14,  9,2,-10,  6,2, -8,  6,2, -4,  9,&
2, -4, 15,2, -8, 15,1,  0,  6,2,  0, 24,2,  6, 24,2,  8, 21,2,  8, 18,2,  6, 15,&
2,  0, 15,1,  2, 15,2,  8,  6,1, 12,  6,2, 12, 24,2, 20,  6,2, 20, 24,0,199, 23,&
1,-10, 21,2,-14, 24,2,-16, 24,2,-20, 21,2,-20,  9,2,-16,  6,2,-14,  6,2,-10,  9 &
                                                                               /
        data PointLoc(3601:4200) / &  !~ASCII characters 200-207
2,-10, 15,2,-14, 15,1, -6,  6,2, -6, 24,2,  0, 24,2,  4, 21,2,  4, 18,2,  0, 15,&
2, -6, 15,1, -2, 15,2,  4,  6,1,  8,  6,2,  8, 24,2, 20,  6,2, 20, 24,0,200, 17,&
1, -8, 21,2,-12, 24,2,-16, 24,2,-20, 21,2,-20,  9,2,-16,  6,2,-12,  6,2, -8,  9,&
1, -6, 24,2,  0, 15,2,  6, 24,1,  0, 15,2,  0,  6,1, 10,  6,2, 10, 24,2, 20,  6,&
2, 20, 24,0,201, 24,1,-20, 18,2,-20,  6,2,-16,  6,1,-14, 24,2, -6, 24,2, -4, 21,&
2, -4, 18,2, -6, 15,2,-14, 15,1, -6, 15,2, -4, 12,2, -4,  9,2, -6,  6,2,-14,  6,&
2,-14, 24,1,  0, 24,2,  0,  6,2,  8,  6,1, 10, 24,2, 10,  9,2, 12,  6,2, 18,  6,&
2, 20,  9,2, 20, 24,0,202, 21,1,-20, 24,2,-12, 24,2, -8, 21,2, -8, 18,2,-12, 15,&
2,-20, 15,1,-12, 15,2, -8, 12,2, -8,  9,2,-12,  6,2,-20,  6,2,-20, 24,1, -4, 24,&
2, -4,  6,2,  6,  6,1,  8, 24,2,  8,  9,2, 12,  6,2, 16,  6,2, 20,  9,2, 20, 24,&
0,203, 27,1,-20, 18,2,-20,  6,2,-16,  6,1, -4, 21,2, -8, 24,2,-10, 24,2,-14, 21,&
2,-14,  9,2,-10,  6,2, -8,  6,2, -4,  9,2, -4, 15,2, -8, 15,1,  0,  6,2,  0, 24,&
2,  6, 24,2,  8, 21,2,  8, 18,2,  6, 15,2,  0, 15,1,  2, 15,2,  8,  6,1, 12, 24,&
2, 16, 15,2, 20, 24,1, 16, 15,2, 16,  6,0,204, 24,1,-10, 21,2,-12, 24,2,-18, 24,&
2,-20, 21,2,-20,  9,2,-18,  6,2,-12,  6,2,-10,  9,2,-10, 15,2,-14, 15,1, -6,  6,&
2, -6, 24,2,  2, 24,2,  4, 21,2,  4, 18,2,  2, 15,2, -6, 15,1, -2, 15,2,  4,  6,&
1,  8, 24,2, 14, 15,2, 20, 24,1, 14, 15,2, 14,  6,0,205, 25,1,-20, 24,2,-12, 24,&
2,-10, 21,2,-10, 18,2,-14, 15,2,-20, 15,1,-14, 15,2,-10, 12,2,-10,  9,2,-12,  6,&
2,-20,  6,2,-20, 24,1, -6,  6,2, -6, 24,2,  2, 24,2,  4, 21,2,  4, 18,2,  2, 15,&
2, -6, 15,1, -2, 15,2,  4,  6,1,  8,  6,2,  8, 24,2, 20,  6,2, 20, 24,0,206, 23,&
1,-20,  6,2,-20, 24,2,-12, 24,2,-10, 21,2,-10, 18,2,-12, 15,2,-20, 15,1, -6,  6,&
2, -6, 24,2,  2, 24,2,  4, 21,2,  4, 18,2,  2, 15,2, -6, 15,1, -2, 15,2,  4,  6,&
1,  8,  6,2,  8, 24,2, 16, 24,2, 18, 21,2, 18, 18,2, 16, 15,2,  8, 15,0,207, 22,&
1,-20, 24,2,-12, 24,2,-10, 21,2,-10, 18,2,-14, 15,2,-20, 15,2,-20, 24,1,-14, 15,&
2,-10, 12,2,-10,  9,2,-12,  6,2,-20,  6,2,-20, 15,1, -6, 24,2, -6,  6,2,  4,  6 &
                                                                               /
        data PointLoc(4201:4800) / &  !~ASCII characters 208-221
1,  8, 24,2,  8,  6,1,  8, 15,2, 20, 24,1, 12, 18,2, 20,  6,0,208, 26,1,-20, 27,&
2,-16, 27,2,-14, 24,2,-14, 18,2,-16, 15,2,-20, 15,2,-20, 27,1, -6, 27,2, -4, 24,&
2, -4, 18,2, -6, 15,2, -8, 15,2,-10, 18,2,-10, 24,2, -8, 27,2, -6, 27,1,  0, 15,&
2,  0, 27,2,  6, 27,1,  0, 21,2,  4, 21,1, 10, 15,2, 10, 27,2, 16, 27,1, 10, 21,&
2, 14, 21,0,209,  8,1,-18, 27,2,-14, 15,2,-10, 27,2, -6, 15,2, -2, 27,1,  8, 24,&
2, 10, 27,2, 10, 15,0,210, 13,1,-18, 27,2,-14, 15,2,-10, 27,2, -6, 15,2, -2, 27,&
1,  4, 24,2,  8, 27,2, 12, 27,2, 16, 24,2, 16, 21,2,  4, 18,2,  4, 15,2, 16, 15,&
0,211, 14,1,-18, 27,2,-14, 15,2,-10, 27,2, -6, 15,2, -2, 27,1,  4, 24,2,  8, 27,&
2, 12, 27,2, 16, 24,2, 10, 21,2, 16, 18,2, 12, 15,2,  8, 15,2,  4, 18,0,212, 10,&
1,-18, 27,2,-14, 15,2,-10, 27,2, -6, 15,2, -2, 27,1,  4, 27,1, 10, 15,2, 10, 27,&
2,  4, 21,2, 16, 21,0,213, 12,1,-18, 27,2,-14, 15,2,-10, 27,2, -6, 15,2, -2, 27,&
1, 16, 27,2,  6, 27,2,  4, 21,2, 14, 21,2, 16, 18,2, 12, 15,2,  4, 15,0,214, 15,&
1,-20, 24,2,-12, 24,1,-16, 24,2,-16,  6,1,-20,  6,2,-12,  6,1, -8, 24,2,  8, 24,&
1,  0, 24,2,  0,  6,1,  4,  6,2, 12, 24,2, 20,  6,1,  8, 15,2, 16, 15,0,215, 17,&
1,-20, 24,2,-20, 12,2,-16,  6,2,-12,  6,2, -8, 12,2, -8, 24,1, -4,  6,2, -4, 24,&
2,  6,  6,2,  6, 24,1, 10, 24,2, 16, 24,2, 20, 18,2, 20, 12,2, 16,  6,2, 10,  6,&
2, 10, 24,0,216, 28,1, -8, 21,2,-12, 24,2,-16, 24,2,-20, 21,2,-20, 18,2, -8, 12,&
2, -8,  9,2,-12,  6,2,-16,  6,2,-20,  9,1, -4, 24,2, -4,  9,2,  0,  6,2,  2,  6,&
2,  6,  9,2,  6, 24,1, 10,  6,2, 10, 24,2, 16, 24,2, 20, 21,2, 20, 18,2, 16, 15,&
2, 10, 15,1, 16, 15,2, 20, 12,2, 20,  9,2, 16,  6,2, 10,  6,0,217, 23,1, -8, 21,&
2,-12, 24,2,-16, 24,2,-20, 21,2,-20, 18,2, -8, 12,2, -8,  9,2,-12,  6,2,-16,  6,&
2,-20,  9,1, -4, 24,2, -4,  9,2,  0,  6,2,  2,  6,2,  6,  9,2,  6, 24,1, 10,  6,&
2, 10, 24,2, 16, 24,2, 20, 21,2, 20, 18,2, 16, 15,2, 10, 15,0,221, 27,1,-20, 27,&
2,-14, 27,2,-12, 24,2,-12, 18,2,-14, 15,2,-20, 15,2,-20, 27,1, -2, 24,2, -4, 27,&
2, -8, 27,2,-10, 24,2, -2, 18,2, -4, 15,2, -8, 15,2,-10, 18,1, 10, 27,2,  2, 27 &
                                                                               /
        data PointLoc(4801:5199) / &  !~ASCII characters 224-239
2,  2, 15,2, 10, 15,1,  2, 21,2,  8, 21,1, 20, 27,2, 12, 27,2, 12, 15,2, 20, 15,&
1, 12, 21,2, 18, 21,0,224, 24,1, -7, -9,2, -7, 21,2, 10, 21,2, 10, 18,2, -4, 18,&
2, -4,  6,2,  8,  6,2,  8,  3,2, -4,  3,2, -4, -9,2, -7, -9,1,  0, 30,2, 12, 27,&
2, 18, 21,2, 20,  6,2, 18, -9,2, 12,-15,2,  0,-18,2,-12,-15,2,-18, -9,2,-20,  6,&
2,-18, 21,2,-12, 27,2,  0, 30,0,225, 17,1, 12,  6,2,  6, 12,2, -6, 12,2,-12,  6,&
2,-12, -6,2, -6,-12,2,  8,-12,2, 12, -6,1, 10, 21,2, 20, 12,2, 20,-12,2, 10,-21,&
2,-10,-21,2,-20,-12,2,-20, 12,2,-10, 21,2, 10, 21,0,226, 18,1, -8, -3,2, -8, 21,&
2,  4, 21,2,  8, 18,2,  8, 12,2,  4,  9,2, -8,  9,1,  2,  9,2,  8, -3,1,  8, 30,&
2, 20, 21,2, 20, -3,2,  8,-12,2, -8,-12,2,-20, -3,2,-20, 21,2, -8, 30,2,  8, 30,&
0,227, 17,1,-18, 24,2,-18, 27,2, -2, 27,2, -2, 24,1,-10, 27,2,-10,  3,1,-12,  3,&
2, -8,  3,1,  0,  3,2,  4,  3,1,  2,  3,2,  2, 27,2, 10, 15,2, 18, 27,2, 18,  3,&
1, 16,  3,2, 20,  3,0,228, 16,1, 12,  6,2,  6, 12,2, -6, 12,2,-12,  6,2,-12, -6,&
2, -6,-12,2,  8,-12,2, 12, -6,1, 20, 21,2, 20,-12,2, 10,-21,2,-20,-21,2,-20, 12,&
2,-10, 21,2, 20, 21,2,-20,-21,0,238,  5,1, 30, 30,2, 30,-30,2,-30,-30,2,-30, 30,&
2, 30, 30,0,239, 19,1, 30, 30,2, 30,-45,2,-30,-45,2,-30, 30,2, 30, 30,1,-30, 15,&
2, 30, 15,1,-30,  0,2, 30,  0,1,-30,-15,2, 30,-15,1,-30,-30,2, 30,-30,1,-14, 30,&
2,-14,-45,1,  0, 30,2,  0,-45,1, 14, 30,2, 14,-45 /
!PointLoc(5199) defined above.                              JMS 2018.08.16.2120
!---------------------------------------------------------------------------7 9
!contains
!---------------------------------------------------------------------------7 9
End Module CharDef
!---------------------------------------------------------------------------7 9

!---------------------------------------------------------------------------7 9
Subroutine AlphaJS(cLabelL,PosLLCq,RpyDq,SizeHq,iCol,fLineWidth,iP)
!2021.10.03.0715cdt JMS- Adapted to print to screen.
!2018.09.12.1035cdt JMS- Modified for TweakEngine to output to a .3dv file.
!                        PosLLCq,RpyDq, & SizeHq are quad precision.
!2018.08.16.2210cdt JMS- Square grid.
!2018.04.06.1620cdt JMS- 7DoF vector-based characters; 
!                          the individual character shapes are specified.
!                      - Traveler2/Athlon64/WinXPPro-32/APF9.0-32

!This supports both: font modification and extension  -and- 
!                    exporting characters as 3D lines.
!2016.06.24.1600cdt JMS- Worked in C - but - color of first character was
!                                              "kluged-to-correctness".

! Unrotated characters are written parallel-to the +X axis,
!                readable from the +Y direction
! in righthanded "Flight Simulation" (abbrev. 'Fs') coordinates.
! 
! Function 'HindSight'- with S.ThreePhase=3: uses Fs-based screen coordinates
!                              "2D/3D"      for the various projection matrices
!                                           +X:forward,+Y:right,+Z:down.
!                  - with S.ThreePhase=2: uses glOrtho (which is non-FS).
!                             "2D ortho"    +X:right,+Y:up, +Z:forward,
!                                           a left-handed coordinate frame.
!
! Use 'PrntOrtho' to write stationary color 2D text on the screen.

!Function 'Colors3D' defines the colors

!VecText.h has the following c* & d* characters encoded,
!   ... however, they presently have no useful effect.
!The objective is to enrich the formatting within a text file
!   by repurposeing some relatively unused characters.
!The key question is: How to easily insert hex code characters in text?
                   
!Custom character usages:
!My colors:        [c][0] 'move without draw' - a no-op in this context
!                           (clarifies & simplifies the content of .3dv files.)
!          White   [c][1]
!          Red        [2]
!  !Green= Magenta    [3]   <- ! = "not"
!  !Blue = Yellow     [4]
!    light Green      [5]
!          Green      [6]
!  !Red  = Cyan       [7]
!    light Blue       [8]
!          Blue       [9]
!    light Gray       [a]
!          Gray       [b]
!          Brown      [c]
!          Purple     [d]
!  !White  Black      [e]
!      user-defined   [f]

! Shape modifiers  [d][0]    toggles-> off
!    Line width    [ ][1] =1.
!                  [ ][2] =2.
!                  [ ][3] =3.
!                  [ ][4] =4.
!                  [ ][5] =5.
!    Italics       [ ][6]    toggle on/off
!    Underlined    [ ][7]      "
!    Subscript     [ ][8]      "
!    Superscript   [ ][9]      "
!                  [ ][a]
!                  [ ][b]
!                  [ ][c]
!    Show controls [ ][d]      "
!                  [ ][e]
!                  [ ][f]                                                   */

 !-----    
 use OpenGLRec,only:  & !Ref: OpenGL GL/GLU/GLUT docs
      glVertex3dv   , glShadeModel, GL_SMOOTH   , GL_FLAT, glBegin &
     ,GL_LINE_STRIP, GL_LINES    , glLineWidth ,glFlush , glEnd, glFlush

 use CharDef                                                        !2018.03.21
!use Tweakrec, only: TL2 !Used in calling Draw3dJTL(TL2,0) to draw every line
!                           segment of each character.
!use opengl_gl
 implicit none                                                       !arguments
  character:: cLabelL*80 !Label- text
  real(8)   :: PosLLCq(3) !     - position of the lower left corner (not homog.)
  real(8)   :: RpyDq(3)   !     - Roll,pitch, & yaw of the label    (not homog.)
  real(8)   :: SizeHq     !     - size
  integer(4):: iCol       !     - color
  real(4)   :: fLineWidth !     - line width
  integer(4):: iP       !Print flag. Prints when iP>5 to unit# IP.
  !--                                                                !Internals
  real(8)   :: PosLLC(3)  !     - position of the lower left corner (not homog.)
  real(8)   :: RpyD(3)    !     - Roll,pitch, & yaw of the label    (not homog.)
  real(8)   :: SizeH      !     - size

  integer(4)::i,iPass,j,j1,j2,k,m,n,nCh,nChars,nPts,nPu
  character:: cA*80, cAi(80)*1      ;equivalence(cA,cAi)
  character:: cB*1 ;integer(4):: iB  ;equivalence(cB,iB )
  !--
  real(8)   ::Pin(3)
  real(8)   ::Pout(3)

  real(8)   ::pXyz(4)   !Homog.i/o- pos.(X,Y,Z,1.)      - per FSCoords  [meters]
  real(8)   ::aRpy(4)   !         - att.(Roll,Pitch,Yaw)-              [degrees]
  real(8)   ::hXR(4,4)  !         - trans & rot matrix- i/o       [i/o:h-meters]
 !integer(4)::Mode      !=1:p&a->h & hinv
  real(8)   ::VecBehind(3)
  integer(4)::iColor    !DOS color
   !---                                                              !--EndDefs

   !-- Compute the text's translation & rotation offset H-matrix:
   PosLLC   = dble(PosLLCq)
   RpyD     = dble(RpyDq  )
   SizeH    = dble(SizeHq )

   pXyz(1:3)=PosLLC; pXyz(4)=1.d0
   aRpy(1:3)=RpyD;   aRpy(4)=1.d0

   call Model7DoF(pXyz,aRpy,1.d0,hXR,iP)

   VecBehind=-hXR(1:3,2)*SizeH/50.d0
  !----- Render the text
   nChars=len_trim(cLabelL)
   cA=Char(0)
   cA(1:nChars)=cLabelL(1:nChars)

  !if(iP.gt.5) write(iP,"('AlphaJS: ',i2,1x,a80)") nChars,cLabelL(1:nChars)
   if(iP.gt.5) write(iP,"('AlphaJS: ',i2,1x,80i4)") nChars &
                                        ,(ichar( cLabelL(i:i) ),i=1,nChars)

   m= 0 !Zero the line counter. 0 is the index of the first line.
   n=-1 !Set the character offset to 'before the first character' of the line
   !Process the incoming label... character by character... starting at (1):
   do i=1,nChars; cB=cAi(i); iB=iand(iB,255); nCh=iB
     if(iB==224) call BreakHere(iP,"S9Font@L444")
     if(iB.le.0) exit
     if(iP.gt.5) write(iP,"('i= ',i2,1x,a1,1x,i3)") i,cB,nCh

          ! Recognize & utilise some of the traditonal control characters
          !   to easily write paragraphs in 7dof space:
     if((nCh.ge.0).and.(nCh.lt.32)) then
       select case(nCh)
        case( 8); n= n-1                    !BackSpace                  '\b'
        case( 9); n=(n+1)/8                 !Horizontal Tab- 8 wide     '\t'
                  n=(n+1)*8-1
        case(11); m=(m  )/5                 !Vertical   Tab- 5 high     '\v'
                  m=(m+1)*5
        case(10); m= m+1                    !Line Feed                  '\n'
        case(13); n=  -1                    !Carriage Return            '\r'
        case(12); m= m+80                   !Form Feed                  '\f'
       end select!nCn
       cycle
     endif!0 <= nCh <32
     n=n+1;                                !move right by one character.
     if(nCh.lt. 32) nCh= 32
     if(nCh.gt.255) nCh=255
     j1   = CharLoc(nCh)
     if((iP>5).and.(nCh==224)) &
       write(iP,"('S9Font@L466  Free Symbol:224 requested.  j1 = ',i6,i4)") &
               j1,PointLoc(j1+2)
     if(j1.eq.0) cycle   !if the character isn't defined- skip to the next one.
     j1   = j1           !This is the beginning of the character's information
     nPts = PointLoc(j1+2)
     if(nPts.eq.0) cycle !if the charcter has no points- go to the next one.
     j2   = j1+(1+nPts)*3!This is the beginning of the following character

                         nPu=    0;      k =   0
     if(iP.gt.5) write(iP,"('i= ',i2,1x,a1,1x,i3,i3,i2)") i,cB,nCh,nPts,iPass
!    Draw the intended character
     iColor=iCol

     call colors3D(iColor)
     if(fLinewidth>0.) call glLineWidth(fLineWidth)
     call glShadeModel(GL_FLAT)
     if(iCol>0) then;call glBegin(GL_LINES);call glEnd;call glFlush !Quirk fix?
     endif !iCol>0)

     call glBegin(GL_LINE_STRIP)
       do j=j1+3,J2-1,3; nPu=nPu+1  !Step through the character's points
         if(PointLoc(j).gt.2) stop "Huge problem!"
         if(PointLoc(j).eq.1) k = 0
                              k = k + 1
        !Draw (or move):   Resize first, the 7th dof, and increment:
         Pin(1) = (  (PointLoc(j+1)+30.d0) /60.d0+ n      ) *SizeH
         Pin(2) =     0.d0
         Pin(3) = ( -(PointLoc(j+2)+30.d0) /60.d0 +m*1.5d0) *SizeH !/20.
        !if(nCh==224) Pin = 1.5d0 * Pin
         !Then translate & rotate... the other 6 dof's:
         Pout(1)=hXR(1,1)*Pin(1)+hXR(1,3)*Pin(3)+hXR(1,4)
         Pout(2)=hXR(2,1)*Pin(1)+hXR(2,3)*Pin(3)+hXR(2,4)
         Pout(3)=hXR(3,1)*Pin(1)+hXR(3,3)*Pin(3)+hXR(3,4)
         if((k==1).and.(j>j1+3)) then
           call glEnd; call glFlush
           call glBegin(GL_LINE_STRIP)
         endif
         call glVertex3dv(Pout)
       enddo!j
     call glEnd !Step through the character's points

   enddo!i
                                                                         return
End Subroutine AlphaJS
!---------------------------------------------------------------------------7 9

Subroutine Model7DoF(Xyzh,Rpyh,S,Model7h,iP)               !version: 2018.08.03
 !        ="Model 7DoF"       ... "DoF" = "Degrees of Freedom"
 !Translation is 3DoF, Rotation is 3Dof, & Scale is 1Dof => 7DoF
 !The general transform for inserting rigid 3D objects into 3D views.
 !This sub routine concatinates (~mashes) all seven effects into a single 4x4
 !   matrix; the pre-concatinated symbolic sub matrices are:
                                                 !The inverse sequence is:
 !1. S = Scale (3D Magnify) the object:             unTranslate
 !   +S , 0 , 0 , 0                                   +1  , 0  , 0  ,-X
 !    0 ,+S , 0 , 0                                    0  ,+1  , 0  ,-Y
 !    0 , 0 ,+S , 0                                    0  , 0  ,+1  ,-Z
 !    0 , 0 , 0 ,+1                                    0  , 0  , 0  ,+1 
 !    (The reciprocals of a diagonal scaling matrix are the inverse.)
 !2. Roll:  sR=sine(Roll), cR=cosine(Roll)          unYaw
 !   +1 , 0 , 0 , 0                                   +cY ,+sY , 0  , 0
 !    0 ,+cR,-sR, 0                                   -sY ,+cY , 0  , 0
 !    0 ,+sR,+cR, 0                                    0  , 0  ,+1  , 0
 !    0 , 0 , 0 ,+1                                    0  , 0  , 0  ,+1
 !3. Pitch: sP=sine(Pitch),cP=cosine(Ptch)          unPitch
 !   +cP, 0 ,+sP, 0                                   +cP , 0  ,-sP , 0
 !    0 ,+1 , 0 , 0                                    0  ,+1  , 0  , 0
 !   -sP, 0 ,+cP, 0                                   +sP , 0  ,+cP , 0
 !    0 , 0 , 0 ,+1                                    0  , 0  , 0  ,+1
 !4. Yaw:   sY=sine(Yaw)  ,cY=cosine(Yaw)           unRoll
 !   +cY,-sY, 0 , 0                                   +1  , 0  , 0  , 0
 !   +sY,+cY, 0 , 0                                    0  ,+cR ,+sR , 0
 !    0 , 0 ,+1 , 0                                    0  ,-sR ,+cR , 0
 !    0 , 0 , 0 ,+1                                    0  , 0  , 0  ,+1
 !  (      The transpose of a pure-rotation matrix is the inverse;
 !    this remains true even after [Yaw]<-[Pitch]<-[Roll] concatenation. )
 !5. Translate to (X,Y,Z):                          unSscale
 !   +1 , 0 , 0 ,+X                                   +1/S, 0  , 0  , 0
 !    0 ,+1 , 0 ,+Y                                    0  ,+1/S, 0  , 0
 !    0 , 0 ,+1 ,+Z                                    0  , 0  ,+1/S, 0
 !    0 , 0 , 0 ,+1                                    0  , 0  , 0  ,+1
 !    (The negatives of a pure-translation matrix are the inverse.)

 !Matrix concatenation sequence:
 !         [5:translate]<-[4:Scale]<-[3:Yaw]<-[2:Pitch]<-[  1:Roll   ]
 ! & for the inverse:
 !         [   unRoll  ]<-[unPitch]<-[unYaw]<-[unScale]<-[untranslate]

 !The resulting (4,4) matrix is implemented below.

 !-----
 implicit none                                                       !arguments
                         !The seven "Degrees of Freedom"(DoF) are:
  real(8)   ::Xyzh(4)     !"translation":  X  ,  Y  ,Z   {,h}   1,2,3
  real(8)   ::Rpyh(4)     !" rotation  ": Roll,Pitch,Yaw {,h}   4,5,6
  real(8)   ::S           !"  scale    ":      scale              7

  real(8)   ::Model7h(4,4) !Resulting homogeneous 7DoF matrix output.

  integer(4)::iP          !Write enable>5: write(iP,...)
 !---                                                                !internals
  real(8)   :: X   ,  Y   ,   Z     !Translations
  real(8)   ::Roll , Pitch,  Yaw    !Rotations
  real(8)   ::sr,cr, sp,cp, sy,cy   !Sines & Cosines
  real(8)   :: H16(16)
  integer(4)::i,j,k
  !-----
  !Extract non-homogeneous values and compute the rotation sines & cosines:
   X    =Xyzh(1)/Xyzh(4)
   Y    =Xyzh(2)/Xyzh(4)
   Z    =Xyzh(3)/Xyzh(4)
   Roll =Rpyh(1)/Rpyh(4); sr=dsind(Roll ); cr=dcosd(Roll )
   Pitch=Rpyh(2)/Rpyh(4); sp=dsind(Pitch); cp=dcosd(Pitch)
   Yaw  =Rpyh(3)/Rpyh(4); sy=dsind(Yaw  ); cy=dcosd(Yaw  )

  !   Translate(X,Y,Z) <- Scale(S) <- Rotate(Roll,Pitch,Yaw)... concatenated.
  !Model 7DoF homogeneous transform:  ------------------------- 2017.05.23.0900
   H16= (/  S*cY*cP , S*(cY*sP*sR-sY*cR) , S*(cY*sP*cR+sY*sR) , X    &  
          , S*sY*cP , S*(sY*sP*sR+cY*cR) , S*(sY*sP*cR-cY*sR) , Y    &  
          ,-S*sP    , S*cP*sR            , S*cP*cR            , Z    &  
          , 0.d0    , 0.d0               , 0.d0               ,+1.d0  /)
   ! ...pack the results in their (4,4) array: 
   k=0; do i=1,4; do j=1,4; k=k+1; Model7h(i,j)=H16(k); enddo; enddo!i

!Concatenated Symbolic Inverse:
!    cY*cP       /S,    sY*cP          /S,   -sP   /S , ( -X* cY*cP          /S
!                   -Y* sY*cP          /S  +Z*sP   /S   )
!(cY*sP*sR-sY*cR)/S,   (sY*sP*sR+cY*cR)/S,    cP*sR/S , ( -X*(cY*sP*sR-sY*cR)/S
!                   -Y*(sY*sP*sR+cY*cR)/S  -Z*cP*sR/S   )
!(cY*sP*cR+sY*sR)/S,   (sY*sP*cR-cY*sR)/S,    cP*cR/S , ( -X*(cY*sP*cR+sY*sR)/S
!                   -Y*(sY*sP*cR-cY*sR)/S  -Z*cP*cR/S   )
! 0                ,    0                ,    0       , (+1)

!Fact N  : Numeric matrix inversion sidesteps solving for symbolic inverses.

   if(iP>5) then
     write(iP,"(/'sub:Model7DoF: ',45('-'))")
     write(iP,"(9x,'user units',13x,'degrees',11x,'multiplier')")
     write(iP,"(' X    =',f12.6,'   Roll=',f12.6,'   Scale=',f12.6)") &
                  X            ,    Roll        ,    S
     write(iP,"(' Y    =',f12.6,'  Pitch=',f12.6)")  Y,Pitch
     write(iP,"(' Z    =',f12.6,'    Yaw=',f12.6)")  Z,Yaw
     write(iP,"( 'Model7h:'         )")
     do i=1,4
       write(iP,"(7x,4f12.6)") (Model7h(i,j),j=1,4)
     enddo!i
   endif !iP>5

   return
End Subroutine Model7DoF
!---------------------------------------------------------------------------7 9

