Board index FlightGear Development New features

Idea about realistic head movement in cockpit

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

Idea about realistic head movement in cockpit

Postby Soitanen » Mon Aug 12, 2013 3:31 pm

I love to turn my head and view different part of cockpits, or some gauges without moving my point of view (I imagine, that I'm the pilot, fastened by seatbelt and cannot move). So I'm using just changing pitch and heading of view. But in real life, when I sit and moving my head, not only pitch and heading is changed, but eyepoint is moving too.
So idea was born. Current viewpoint must be centre of the little sphere (radius about 10-15 cm). Rendering must be processed from point where pitch-heading line intersects that sphere. So, when I will move my head (with help of my mouse), my eyes in virtual reality will move too.

Is it hard to implement this feature?
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 6:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: Idea about realistic head movement in cockpit

Postby Hooray » Mon Aug 12, 2013 3:57 pm

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: 11472
Joined: Tue Mar 25, 2008 8:40 am

Re: Idea about realistic head movement in cockpit

Postby Johan G » Mon Aug 12, 2013 7:38 pm

I have been thinking about that as well from time to time, mostly when I would want to look over my shoulder but instead look into the head rest.

/!\ Long post

Earlier today, while looking for something completely different, I stumbled upon MIL-STD-1472G Department of Defense* Design Criteria Standard: Human Engineering, which contains a few metrics that can be useful (see pages 109, 219 and 353 in the PDF or 89, 199 and 333 in the document). I saw now that they even had metrics specifically from aircrew. :D

While the limits for head and eye movements is interesting, the height from the neck to the eye level as well as the height to the neck and the breadth of the shoulders is of interest as when twisting the upper body to look "over the shoulder" (i.e. when checking six o'clock).

One other thing to consider is the tendency to put the eyes level to the horizon in banks and turns. What I would expect to be really tricky though is to combine the head and eye movements in a natural way, as it seems that quicker movements are generally done eyes only, if it is within their limits of movement.

If this would come to life and work out well, I think it should be optional, like the dynamic view option.


This YouTube video can serve as an illustration to how typical ways (fighter) pilots move the upper body, head and eyes in various aircraft:




Measurements from MIL-STD-1472G

Upper body measurements in a seated position
Mid-shoulder height 68.6 cm
Mid-shoulder to eye height 12.4 cm
Shoulder breadth 53.4 cm (needed when twisting upper body to look over shoulder)

Eye movement limits
Up 40°
Down 20°
Lateral ±35°

Head movement limits (in addition to the eye movement limits)
Rotation ±92°(horizontally around neck)
Lateral 48°, to the sides
Extension 88°, backward
Flextion 72°, backward


* Not my misspelling. Edit: Ah, another case of UK versus US spelling. :wink:
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: 5546
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: Idea about realistic head movement in cockpit

Postby Gijs » Mon Aug 12, 2013 8:41 pm

Using a headtracker would be the easiest and most intuitive option. E.g. Http://wiki.flightgear.org/FaceTrackNoIR or similar. I'm afraid doing such things with keys/mouse will always be tedious...
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9390
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Idea about realistic head movement in cockpit

Postby Johan G » Tue Aug 13, 2013 6:15 pm

Gijs wrote in Mon Aug 12, 2013 8:41 pm:Using a headtracker would be the easiest and most intuitive option.

I completely agree there. :D Those translations and rotations could probably also be used to animate the pilot without to much of a hassle as well.

The single biggest trouble with trying to get head movements natural is probably that eye movements to a large degree is independent of the head movement, as illustrated in the video above. A head tracker, or better yet VR-goggles (like e.g. the Occulus Rift), is most probably a lot more transparent in use than would be possible the other way.

But if anyone is interested in experimenting with animating the viewpoint, feel free to. If not for else for the learning experience. :wink:
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: 5546
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: Idea about realistic head movement in cockpit

Postby Soitanen » Wed Oct 29, 2014 3:08 pm

So, after loooong time I have modified view.nas and function works!

Please, review code change, and merge into git, if possible. Feature work only if viewlimits for view are defined (expecting that viewlimits defined only for pilot view, so enabling this only in this case).

Code: Select all
diff --git a/Nasal/view.nas b/Nasal/view.nas
index 41e05e9..14d3159 100644
--- a/Nasal/view.nas
+++ b/Nasal/view.nas
@@ -432,6 +432,11 @@ var pilot_view_limiter = {
       me.xoffsetN = props.globals.getNode("/sim/current-view/x-offset-m");
       me.xoffset_lowpass = aircraft.lowpass.new(0.1);
       me.last_offset = 0;
+      me.pitchN = props.globals.getNode("/sim/current-view/pitch-offset-deg");
+      me.yoffsetN = props.globals.getNode("/sim/current-view/y-offset-m");
+      me.last_yoffset = 0;
+      me.zoffsetN = props.globals.getNode("/sim/current-view/z-offset-m");
+      me.last_zoffset = 0;
       me.needs_start = 0;
    },
    start : func {
@@ -466,6 +471,7 @@ var pilot_view_limiter = {
       me.start();
 
       var hdg = normdeg(me.hdgN.getValue());
+      var pitch = normdeg(me.pitchN.getValue());
       if (abs(me.last_hdg - hdg) > 180)  # avoid wrap-around skips
          me.hdgN.setDoubleValue(hdg = me.last_hdg);
       elsif (hdg > me.left.heading_max)
@@ -476,15 +482,24 @@ var pilot_view_limiter = {
 
       # translate view on X axis to look far right or far left
       if (me.enable_xoffset) {
+         var headRadius = 0.08382;
          var offset = 0;
          if (hdg > me.left.threshold)
             offset = (me.left.threshold - hdg) * me.left.scale;
          elsif (hdg < me.right.threshold)
             offset = (me.right.threshold - hdg) * me.right.scale;
 
-         var new_offset = me.xoffset_lowpass.filter(offset);
+         var new_offset = me.xoffset_lowpass.filter(offset) - math.sin(hdg * D2R) * math.cos(pitch * D2R) * headRadius;
          me.xoffsetN.setDoubleValue(me.xoffsetN.getValue() - me.last_offset + new_offset);
          me.last_offset = new_offset;
+
+         var new_yoffset = math.sin(pitch * D2R) * headRadius;
+         me.yoffsetN.setDoubleValue(me.yoffsetN.getValue() - me.last_yoffset + new_yoffset);
+         me.last_yoffset = new_yoffset;
+
+         var new_zoffset = abs(math.sin(pitch * D2R)) * abs(math.sin(hdg * D2R)) * headRadius;
+         me.zoffsetN.setDoubleValue(me.zoffsetN.getValue() - me.last_zoffset + new_zoffset);
+         me.last_zoffset = new_zoffset;
       }
       return 0;
    },


When rotating head it gives new impressions - move head up and see a little bit more runway before airplane, move down - and something remained out of sight. Head radius is taken from Boeing document about aircraft taxiing - there were defined, that head rotates about point 3.3 in aft of initial eyes position.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 6:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17


Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest