Board index FlightGear Development New features

FGCursor (3d cursor)

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

FGCursor (3d cursor)

Postby Marius_A » Mon Feb 29, 2016 10:54 pm

I have prototyped a simple 3d cursor. The working principle is similar to tutorial marker. Additionally, it supports bindings and cursor grouping (e.g. instrument panel cursors, overhead panel cursors, ...). It may be used to control altimeter, radios, lights, navigation instruments while keeping both hands on main flight controls. The future plan is to implement more cockpit cursor types, add scenery markers, hoops (might be useful for tutorials/missions).
Preview:


Installation
  1. Download
  2. Extract to fgroot/Nasal

Implementation

  1. include cursor in aircraft's model xml file:
    Code: Select all
    <PropertyList>
       ...
       <model>
          <name>fgcursor</name>
          <path>Nasal/fgcursor/Models/cursor.xml</path>
       </model>
       ...
    </PropertyList>

  2. Create cursor configuration xml files in aircraft's folder:
    Code: Select all
    <PropertyList>
       <cursor n="0">
          <x-m>1.28</x-m>
          <y-m>0.811</y-m>
          <z-m>0.079</z-m>
          <pitch-deg>-10</pitch-deg>
          <scale>0.4</scale>
          <neighbours> <!-- indices of neighbouring cursors -->
             <top>6</top>
             <bottom>4</bottom>
             <left>2</left>
             <right>0</right>
          </neighbours>
          <binding>
             ...
          </binding>
          <binding>
             ...
          </binding>
       </cursor>
       <cursor n="1">
          ...
       </cursor>
       ...
    </PropertyList>

  3. Register cursor configuration files in aircraft's -set.xml file:
    Code: Select all
    <PropertyList>
       ...
       <sim>
          ...
          <fgcursor>
             <cursor-group n="0">
                <name>Instrument panel</name>
                <path>cursors/instrument-panel.xml</path>
             </cursor-group>
             <cursor-group n="1">
                <name>Overhead panel</name>
                <path>cursors/overhead-panel.xml</path>
             </cursor-group>
             ...
          </fgcursor>
          ...
       </sim>
       ...
    </PropertyList>

Commands

Cursor is controlled using fgcommands:
  • Move cursor in specific direction (needs to have properly defined neighbouring cursors):
    Code: Select all
    <binding>
       <command>fgcursor-move</command>
       <direction>top</direction>
    <binding>

    <binding>
       <command>fgcursor-move</command>
       <direction>bottom</direction>
    <binding>

    <binding>
       <command>fgcursor-move</command>
       <direction>left</direction>
    <binding>

    <binding>
       <command>fgcursor-move</command>
       <direction>right</direction>
    <binding>

  • Run cursor bindings:
    Code: Select all
    <binding>
       <command>fgcursor-binding</command>
    <binding>
  • Cycle through cursor groups:
    Code: Select all
    <binding>
       <command>fgcursor-next-group</command>
    <binding>

    <binding>
       <command>fgcursor-prev-group</command>
    <binding>

  • Cycle through cursors in the same group:
    Code: Select all
    <binding>
       <command>fgcursor-next-cursor</command>
    <binding>

    <binding>
       <command>fgcursor-prev-cursor</command>
    <binding>
Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: FGCursor (3d cursor)

Postby jaxsin » Tue Mar 01, 2016 12:24 pm

Oh nice work, I will be trying this out
jaxsin
 
Posts: 396
Joined: Mon Dec 28, 2015 3:54 pm

Re: FGCursor (3d cursor)

Postby hamzaalloush » Tue Mar 01, 2016 4:12 pm

nice work(as always!),

can this be modified so that it can work with a head tracker highlighting buttons? and then using shortcuts to change them? that would be super-cool!
hamzaalloush
 
Posts: 632
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

Re: FGCursor (3d cursor)

Postby Hooray » Tue Mar 01, 2016 4:23 pm

I agree, this looks awesome - and if this gets integrated with tutorials/missions (or possibly even checklists), this could easily be one of the most commonly mentioned "gadgets" in future FlightGear reviews.

Great work !
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11603
Joined: Tue Mar 25, 2008 8:40 am

Re: FGCursor (3d cursor)

Postby rominet » Wed Mar 02, 2016 8:32 am

Agreed, the effect is beautiful! I hope this will be included in standard FG. It's always a pity to have very good work stay separate from FG, and thus from most of its potential users...
rominet
 
Posts: 557
Joined: Sat Nov 01, 2014 1:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: FGCursor (3d cursor)

Postby Michat » Fri Mar 04, 2016 2:31 pm

Agree with you guys.

I'm going to try it and see if it affects my very low performance. If not I'll suggest too to be included in standard FG because it is so cute cursor.

Congrats for another good contribution.
User avatar
Michat
 
Posts: 1007
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: FGCursor (3d cursor)

Postby Marius_A » Sat Mar 12, 2016 5:42 pm

hamzaalloush wrote in Tue Mar 01, 2016 4:12 pm: ... can this be modified so that it can work with a head tracker highlighting buttons? and then using shortcuts to change them? ...

Interesting idea :)
Maybe headtracker input range could be divided into segments and each segment could be associated with cursor name or cursor group?


Progress report
Updated version download link (contains cursors for DR-400 dauphin).
  1. Several cursor types, cursor group outlines:

  2. "Development mode" for cursor and group outline positioning and sizing (type gui.showDialog("fgcursor-adjustment"); to Nasal console):

    Configuration data is exported to fghome/Export/fgcursor-export.xml.

  3. Cursor configuration *.xml files and *.nas files are loaded automatically from [aircraft-dir]/cursors;
  4. Cursor .xml file structure:
    Code: Select all
    <PropertyList>
      <name>cursor group name</name>
      <group-outline>
        <x-m>...</x-m>
        <y-m>...</y-m>
        <z-m>...</z-m>
        <pitch-deg>...</pitch-deg>
        <x-scale>...</x-scale>
        <y-scale>...</y-scale>
        <neighbours>
          <top>neighbouring group name or index</top>
          <bottom>...</bottom>
          <left>...</left>
          <right>...</right>
        </neighbours>
      </group-outline>
      <cursor>
        ...
      </cursor>
      <cursor>
        ...
      </cursor>
      ...
    </PropertyList>

  5. New command:
    Code: Select all
    <command>fgcursor-move-group</command>
    <direction>top / bottom / left / right<direction>
Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: FGCursor (3d cursor)

Postby Catalanoic » Sat Mar 12, 2016 6:29 pm

Awesome work and effects too!
User avatar
Catalanoic
 
Posts: 1068
Joined: Mon Mar 05, 2012 12:33 am
Location: Barcelona (LEBL)
Callsign: Catalanoic
Version: 2017.3
OS: Lubuntu/Windows 7

Re: FGCursor (3d cursor)

Postby Johan G » Sat Mar 12, 2016 7:12 pm

Those videos look great. :D

I hope you are discussing this on the mailing list as well. I would very much like to see this as a part of FlightGear a few releases away. This would be excellent for tutorials. Also, for some reason I value the groups nearly more than the individual markers.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5634
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: FGCursor (3d cursor)

Postby f-ojac » Tue Mar 15, 2016 7:27 pm

Excellent work! Hope to have it built-in FG soon!
Hosting terrasync, World Scenery, TGWeb on my own private server. Click here to donate and help to make the service last.
f-ojac
 
Posts: 1285
Joined: Fri Mar 07, 2008 9:50 am
Version: GIT
OS: GNU/Linux


Return to New features

Who is online

Users browsing this forum: No registered users and 3 guests