Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Roy Vegard Ovesen
On Tuesday 23 November 2004 01:16, Alex Perry wrote:
 From: Boris Koenig [EMAIL PROTECTED]

  David Megginson wrote:
   I understand
   that there are USB devices that you can wear on your head to control
   the view in games, and those would probably work in FlightGear, but it
   would be hard to survive the ridicule from family, friends, and
   neighbours for wearing one.
 
  LOL, that would indeed be very amusing ... must probably look very
  similar to the BORG on Star Trek ;-)

 There are two different things here.

 Normally, for gaming, people want to keep their head stationary
 (in linear dimensions) and look in different directions (angular).
 What people are talking about here is wanting to keep their
 direction of gaze (fixed object) but change their point of view.

 The former is easily addressed with a simple magnetic compass module,
 to figure out which way you're looking, and a head mount display so
 that the screen is always located in the correct direction (in front).
 The compass module is usually integrated into the HMD and so not really
 a source of looking 'odd', at least compared to the HMD unit itself.

 However, the compass module doesn't work when the user wants to be able
 to move their head and still look in the same direction.  For example,
 to lean forward in order to read the tiny little numbers on the altimeter.
 For that, you need to track the position of the head, not direction,
 so you really want a different kind of sensor to address that need.
 You don't need a HMD either, since the instrument panel doesn't move.
 There are sensors for this, for example by putting ultrasonic ranging
 transducers on your head and on the four corners of the monitor,
 but nothing I'd really recommend to you as being a marvellous solution.

 Assuming there is a network socket that is providing the 3D position
 of the nose (for example) of the user with respect to the monitor,
 how hard is it to get FGFS to slew the camera/viewport relationship ?

The properties for the camera/viewport 
are: /sim/current-view/{x,y,z}-offset-m. So it should be quite easy.

I've attached a patch to mice.xml that lets you move the camera/viewport with 
the middle mouse button pressed in mouse view mode. Useful for looking at the 
compass head on.

-- 
Roy Vegard Ovesen
Index: mice.xml
===
RCS file: /var/cvs/FlightGear-0.9/data/mice.xml,v
retrieving revision 1.16
diff -p -u -r1.16 mice.xml
--- mice.xml	24 Jun 2004 14:45:48 -	1.16
+++ mice.xml	23 Nov 2004 12:33:33 -
@@ -208,7 +208,7 @@ current mode for each mouse is held in t
!-- Mouse left/right motion --
x-axis
 
-!-- No buttons pressed: move the view position left or right --
+!-- No buttons pressed: rotate the view left or right --
 binding
  condition
   and
@@ -228,6 +228,25 @@ current mode for each mouse is held in t
  wrap type=booltrue/wrap
 /binding
 
+
+!-- Middle button pressed: move the view position left or right --
+binding
+ condition
+  and
+   not
+property/devices/status/mice/mouse[0]/button[0]/property
+   /not
+   property/devices/status/mice/mouse[0]/button[1]/property
+  /and
+ /condition
+ commandproperty-adjust/command
+ property/sim/current-view/x-offset-m/property
+ factor type=double1/factor
+ min type=double-0.5/min
+ max type=double0.5/max
+ wrap type=boolfalse/wrap
+/binding
+
/x-axis
 
!-- Mouse up/down motion --
@@ -252,6 +271,25 @@ current mode for each mouse is held in t
  max type=double90/max
  wrap type=boolfalse/wrap
 /binding
+
+!-- Middle button pressed: move the view up and down --
+binding
+ condition
+  and
+   not
+property/devices/status/mice/mouse[0]/button[0]/property
+   /not
+property/devices/status/mice/mouse[0]/button[1]/property
+  /and
+ /condition
+ commandproperty-adjust/command
+ property/sim/current-view/y-offset-m/property
+ factor type=double-1/factor
+ min type=double-0.5/min
+ max type=double0.5/max
+ wrap type=boolfalse/wrap
+/binding
+
/y-axis
 
   /mode
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

[Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Tuesday 23 November 2004 13:41:
 I've attached a patch to mice.xml that lets you move the camera/viewport with 
 the middle mouse button pressed in mouse view mode. Useful for looking at the 
 compass head on.

Very cool. There are two problems, though: I can move my 'head' down very far
(below the bo105's floor), but I can hardly move it up. And the possibility to
restore the original position on middle mouse click is lost. (I tend to keep 
that
patch applied anyway. :-)

m.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Roy Vegard Ovesen
On Tuesday 23 November 2004 14:18, Melchior FRANZ wrote:
 * Roy Vegard Ovesen -- Tuesday 23 November 2004 13:41:
  I've attached a patch to mice.xml that lets you move the camera/viewport
  with the middle mouse button pressed in mouse view mode. Useful for
  looking at the compass head on.

 Very cool. There are two problems, though: I can move my 'head' down very
 far (below the bo105's floor), but I can hardly move it up. And the
 possibility to restore the original position on middle mouse click is lost.
 (I tend to keep that patch applied anyway. :-)

I only tested it in the default cessna where max and min limits of 0.5 meters 
from the origin seemed reasonable, you can imagine what happened when I tried 
the A320 where the initial y-offset is way above 0.5 meters :-(. Perhaps the 
movement limits should be aircraft specific, any volunteers ;-)

Restoring the original position with the _middle_ button? I'm only familiar 
with restoring the orientation with the _left_ button. I guess that it would 
be possible to also restore the position with the left button, but I think 
that restoring the orientation only is actually quite usefull.

I've also noticed that the position sometimes jumps to it's min or max 
position, this seem to happen when the cursor wraps from from one edge of the 
screen to the opposite.

-- 
Roy Vegard Ovesen

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Tuesday 23 November 2004 15:51:
 I only tested it in the default cessna where max and min limits of 0.5 meters 
 from the origin seemed reasonable, you can imagine what happened when I tried 
 the A320 where the initial y-offset is way above 0.5 meters :-(. Perhaps the 
 movement limits should be aircraft specific, any volunteers ;-)

volunt.. WHAT?!? ... Having this settable per aircraft would be nice.



 Restoring the original position with the _middle_ button? I'm only familiar 
 with restoring the orientation with the _left_ button.

Whoops, OK. (As an excuse: I do normally reset the view direction with my
js -- even have two separate functions there. Was so excited about the new
mouse functionality, that I got this wrong. Sorry. Cancel the second
complaint, then. :-) 

m.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Tuesday 23 November 2004 15:51:
 I only tested it in the default cessna where max and min limits of 0.5 meters 
 from the origin seemed reasonable,

Should have tried the FA-18A. Completely unusable there. You immediately
end up between the pilot's legs and there's no way to get back up. But can
go further down and watch the scenery through the open front wheel bay.
Resetting fgfs doesn't help either. But once fixed this feature will be
very useful.

m.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Roy Vegard Ovesen
On Tuesday 23 November 2004 16:30, Melchior FRANZ wrote:
 Should have tried the FA-18A. Completely unusable there. You immediately
 end up between the pilot's legs and there's no way to get back up. But can
 go further down and watch the scenery through the open front wheel bay.
 Resetting fgfs doesn't help either. But once fixed this feature will be
 very useful.

Yes, that's what happened in the Airbus too, and it should also happen to any 
large aircraft. You can easily fix this by making the min and max values in 
mice.xml greater. I set them to -10 and 10 meters respectively for both x and 
y axes, I guess that should be enough for most aircraft.

Setting these limits to reasonable values (inside the cockpit) for every 
aircraft would be, as you can imagine, quite a labourous job. Maybe someone 
over on the users list would be willing to have a go at it? Every so often I 
see users that ask how to contribute.

-- 
Roy Vegard Ovesen

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


RE: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Norman Vine
Melchior FRANZ writes:
 
 * Melchior FRANZ -- Tuesday 23 November 2004 17:14:
  I'm volunteering already
 
 No, I take that back. Mouse properties are (like kbd * js bindings)
 fixed at the beginning. min/max can't easily be changed afterwards,
 and I don't feel like re-writing the whole input module. Better set
 the default to +/- 5m.

Can't you just load the properties that you want 
and then call reinit() on the whole FGInput subsytem

Norman

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Melchior FRANZ
* Norman Vine -- Tuesday 23 November 2004 18:19:
* * Melchior FRANZ writes:
  Mouse properties are (like kbd * js bindings)
  fixed at the beginning. min/max can't easily be changed afterwards,
  and I don't feel like re-writing the whole input module. Better set
  the default to +/- 5m.
 
 Can't you just load the properties that you want 
 and then call reinit() on the whole FGInput subsytem

What I had: {x,y}-offset-{min,max}-m settings for each view
(only really defined for cockpit view, but settable for the
others as well). Aircraft specific settings in the bo105 config,
and changes to src/Main/viewmgr.cxx that would copy the correct
settings to /view/current-view. mice.xml used property aliases
that pointed there. It all worked, except that the mouse didn't
care for the changed properties.

re-init-ing js/kbd/mice with every view change should have worked,
but isn't that a bit too expensive? And even if only the mouse
parts were re-init-ed, this sounds like a work-around, rather than
a solution.

m.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Roy Vegard Ovesen
On Tuesday 23 November 2004 18:05, Melchior FRANZ wrote:
 No, I take that back. Mouse properties are (like kbd * js bindings)
 fixed at the beginning. min/max can't easily be changed afterwards,
 and I don't feel like re-writing the whole input module. Better set
 the default to +/- 5m.

You can include only the required axis bindings in your aircraft *-set.xml 
file, like this (for the default cessna):

input

  mice

  mouse n=0
  !-- Mode 2: view mode --
  mode n=2
   
   !-- Mouse left/right motion --
   x-axis

!-- No buttons pressed: rotate the view left or right --
binding
 condition
  and
   not
property/devices/status/mice/mouse[0]/button[0]/property
   /not
   not
property/devices/status/mice/mouse[0]/button[1]/property
   /not
  /and
 /condition
 commandproperty-adjust/command
 property/sim/current-view/heading-offset-deg/property
 factor type=double-360/factor
 min type=double0/min
 max type=double360/max
 wrap type=booltrue/wrap
/binding


!-- Middle button pressed: move the view position left or right --
binding
 condition
  and
   not
property/devices/status/mice/mouse[0]/button[0]/property
   /not
   property/devices/status/mice/mouse[0]/button[1]/property
  /and
 /condition
 commandproperty-adjust/command
 property/sim/current-view/x-offset-m/property
 factor type=double0.75/factor
 min type=double-0.5/min
 max type=double0.5/max
 wrap type=boolfalse/wrap
/binding

   /x-axis

   !-- Mouse up/down motion --
   y-axis

!-- No buttons pressed: tilt the view up and down --
binding
 condition
  and
   not
property/devices/status/mice/mouse[0]/button[0]/property
   /not
   not
property/devices/status/mice/mouse[0]/button[1]/property
   /not
  /and
 /condition
 commandproperty-adjust/command
 property/sim/current-view/pitch-offset-deg/property
 factor type=double-180/factor
 min type=double-90/min
 max type=double90/max
 wrap type=boolfalse/wrap
/binding

!-- Middle button pressed: move the view up and down --
binding
 condition
  and
   not
property/devices/status/mice/mouse[0]/button[0]/property
   /not
property/devices/status/mice/mouse[0]/button[1]/property
  /and
 /condition
 commandproperty-adjust/command
 property/sim/current-view/y-offset-m/property
 factor type=double-0.75/factor
 min type=double-0.4/min
 max type=double0.4/max
 wrap type=boolfalse/wrap
/binding

   /y-axis

  /mode

 /mouse

 /mice
 /input

This will override the settings in mice.xml, but it will only override the 
settings that are defined here, so all the existing modes in mice.xml are 
used. As I said earlier it will be a lot of work to do this to every aircraft 
model.

-- 
Roy Vegard Ovesen

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Boris Koenig
Roy Vegard Ovesen wrote:
On Tuesday 23 November 2004 18:05, Melchior FRANZ wrote:
No, I take that back. Mouse properties are (like kbd * js bindings)
fixed at the beginning. min/max can't easily be changed afterwards,
and I don't feel like re-writing the whole input module. Better set
the default to +/- 5m.

You can include only the required axis bindings in your aircraft *-set.xml 
file, like this (for the default cessna):
[...]

This will override the settings in mice.xml, but it will only override the 
settings that are defined here, so all the existing modes in mice.xml are 
used. As I said earlier it will be a lot of work to do this to every aircraft 
model.
Please correct me if I am wrong:
- There are only two parameters that are a/c specifc: min/max ?
- The tags for custom bindings remain basically identical ?
If the above is true to some extent, my suggestion for a temporary
workaround would be to use an external file that takes care of
the bindings, but uses parameters taken from the property tree
instead of fixed values:
I have done something very similar when I needed to add support for
dynamic layer positioning (to be able to use nasal code to re-position
layers based on certain actions), by using a property child instead
of a fixed value within the x/ or y/ tags.
So, one could think about using one general bindings file that's
included by the *-set.xml files - that way each aircraft could
put its min/max values directly into the right location within
the property tree.
What do you think, am I still missing the point ? :-)

-
Boris
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Lee Elliott
On Tuesday 23 November 2004 00:16, Alex Perry wrote:
 From: Boris Koenig [EMAIL PROTECTED]

  David Megginson wrote:
   I understand
   that there are USB devices that you can wear on your head
   to control the view in games, and those would probably
   work in FlightGear, but it would be hard to survive the
   ridicule from family, friends, and neighbours for wearing
   one.
 
  LOL, that would indeed be very amusing ... must probably
  look very similar to the BORG on Star Trek ;-)

 There are two different things here.

 Normally, for gaming, people want to keep their head
 stationary (in linear dimensions) and look in different
 directions (angular). What people are talking about here is
 wanting to keep their direction of gaze (fixed object) but
 change their point of view.

 The former is easily addressed with a simple magnetic compass
 module, to figure out which way you're looking, and a head
 mount display so that the screen is always located in the
 correct direction (in front). The compass module is usually
 integrated into the HMD and so not really a source of looking
 'odd', at least compared to the HMD unit itself.

 However, the compass module doesn't work when the user wants
 to be able to move their head and still look in the same
 direction.  For example, to lean forward in order to read the
 tiny little numbers on the altimeter. For that, you need to
 track the position of the head, not direction, so you really
 want a different kind of sensor to address that need. You
 don't need a HMD either, since the instrument panel doesn't
 move. There are sensors for this, for example by putting
 ultrasonic ranging transducers on your head and on the four
 corners of the monitor, but nothing I'd really recommend to
 you as being a marvellous solution.

 Assuming there is a network socket that is providing the 3D
 position of the nose (for example) of the user with respect to
 the monitor, how hard is it to get FGFS to slew the
 camera/viewport relationship ? I've got stuff lying around at
 work here that is fairly cheap and can be made to do the
 sensing job, so it'd be interesting to try it out ...

I had a bit of a go at something along the lines of moving the 
viewpoint in the Comper Swift.  The design of the a/c meant that 
the wing was directly in front of the eyes (in early models of 
the Swift the altimeter and airspeed indicator were set into the 
cut-out in the trailing edge of the wing around the cockpit) so 
it was necessary for the pilot to lean out to either side to get 
a view directly ahead.  As the Swift didn't have flaps I 
re-mapped the key bindings to move the cockpit view sideways - 
when I get around to updating it I'll use Nasal to handle it.

Anyway, when I also get around to making the 3d instruments for 
the cockpit, the viewpoint change should work with the 3d 
instruments, one of which, iirc, was a horizontally mounted mag 
compass that cantilevered out from the panel.

LeeE


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Roy Vegard Ovesen
On Tuesday 23 November 2004 19:55, Melchior FRANZ wrote:
 Sure, but that's yet another ugly hack. I'd prefer a *solution*. I don't
 use a standard mice.xml, and I would really hate if every aircraft designer
 messes with mouse settings and overwrites my stuff. What's next? Aircrafts
 overwriting my carefully chosen joystick settings? No wait, that's already
 done in (the otherwise beautifully) b1900d ...

I really thought that overriding defaults from preferences.xml was a good 
solution. *-set.xml is used to override all kinds of other stuff, including 
keyboard and joystick settings, so why not override mouse settings too!?

-- 
Roy Vegard Ovesen

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: Magnetic Compass

2004-11-23 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Tuesday 23 November 2004 20:39:
 I really thought that overriding defaults from preferences.xml was a good 
 solution. *-set.xml is used to override all kinds of other stuff, including 
 keyboard and joystick settings, so why not override mouse settings too!?

Aircrafts aren't supposed to override all sorts of setting -- only theirs!
For example, even if preferences.xml says that the flaps shall not be
lowered by default, the aircraft may *of course* override that. (Who owns
the flaps?)

There are other groups of properties that are not owned by the aircraft. I
would not accept that an aircraft config file changes the weather or the
daytime. That's world stuff. Nor would I accept if one changed sim stuff
(e.g. the rendering method) or hardware stuff (mouse/joystick). One
aircraft, for example, tried to disable the atc and ai-model subsystems.
No need to mention that this was thrown out.

As a workaround I'd rather set min/max to 2 or 3m for all aircrafts. And
the ideal solution would be to let the input system really *use* properties,
not just to read them once at startup and never look at them again.  :-)

m.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: Magnetic Compass

2004-11-22 Thread Alex Perry
From: Boris Koenig [EMAIL PROTECTED]
 David Megginson wrote:
  I understand
  that there are USB devices that you can wear on your head to control
  the view in games, and those would probably work in FlightGear, but it
  would be hard to survive the ridicule from family, friends, and
  neighbours for wearing one.
 LOL, that would indeed be very amusing ... must probably look very
 similar to the BORG on Star Trek ;-)

There are two different things here.

Normally, for gaming, people want to keep their head stationary
(in linear dimensions) and look in different directions (angular).
What people are talking about here is wanting to keep their
direction of gaze (fixed object) but change their point of view.

The former is easily addressed with a simple magnetic compass module,
to figure out which way you're looking, and a head mount display so
that the screen is always located in the correct direction (in front).
The compass module is usually integrated into the HMD and so not really
a source of looking 'odd', at least compared to the HMD unit itself.

However, the compass module doesn't work when the user wants to be able
to move their head and still look in the same direction.  For example,
to lean forward in order to read the tiny little numbers on the altimeter.
For that, you need to track the position of the head, not direction,
so you really want a different kind of sensor to address that need.
You don't need a HMD either, since the instrument panel doesn't move.
There are sensors for this, for example by putting ultrasonic ranging
transducers on your head and on the four corners of the monitor,
but nothing I'd really recommend to you as being a marvellous solution.

Assuming there is a network socket that is providing the 3D position
of the nose (for example) of the user with respect to the monitor,
how hard is it to get FGFS to slew the camera/viewport relationship ?
I've got stuff lying around at work here that is fairly cheap and can
be made to do the sensing job, so it'd be interesting to try it out ...


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d