Board index FlightGear Development New features

Tracking view.

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

Tracking view.

Postby Kabuki » Tue Jul 26, 2011 7:32 pm

Something I miss in FG is a way to view other aircraft from the viewpoint of the cockpit. It's available on one combat sim I used to fly, and it's probably the most important view mode to use for dogfighting.

It would pan the view from the cockpit viewpoint to another aircraft. It would have to pan, rather than simply give another view, in order to get a feel for the other plane's relative position. It would also require a couple of dedicated keys -- one to select the target, and another to switch back to the forward view.

I know FG is not intended as a combat sim, but the ability to look at other planes in the sky isn't strictly a combat-only activity. It would also be *very* useful to be able to select a runway threshold as the view target, for obvious reasons.

Is there any interest in helping me with this? I've done some work on it, and gotten far enough to know that I'm trying to do it all wrong. I don't fully understand how "lookat" and "lookfrom" work...
This is a family-friendly saloon. No talk stink.
Kabuki
 
Posts: 584
Joined: Fri Oct 23, 2009 11:21 pm
Location: Usually on the ground, always in the sky, except when underwater.
Callsign: Kabuki
Version: 3.0.0
OS: Windows 7

Re: Tracking view.

Postby Johan G » Wed Jul 27, 2011 8:50 pm

You could post the "hackery" you mentioned in the How about a GUI for radar tracking? topic within code tags in this topic. :wink:

I've noticed that there is a nasal script, $FlightGear/data/Nasal/view.nas, that seems to handle the views, panning etc. It has a view.point.move(<prop> [, <time>]); method that should make it possible to follow a view direction / object, :) though it doesn't seem all that easy to use. :roll:
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: 6090
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Tracking view.

Postby Kabuki » Mon Aug 01, 2011 9:38 pm

Posting my code would probably do more harm than good. I hadn't looked at it since February, and it's pretty messy. It comprises several files that need to be here and there, and I was constantly hacking it in the crudest way.

My approach was to use the cockpit view and get bogey information from the /ai/models/aircraft[x]/radar/ data, then adjust my view offset accordingly. Two problems with that were that it didn't automatically follow the bogey. It simply turned your view in that direction. The other problem was that the offset and elevation information from radar didn't account for your own orientation. If you were flying level, it would point your view correctly. But if you were rolling or pitching, some calculations were required to compensate, and I never could figure those out.

I think the better approach would be to take an existing view and modify it. But I can't figure them out. There seems to be some black magic going on. E.g. the 'model' view looks at other planes, but from where? And how does it know which plane to look at when you change your target via the arrows at the bottom left of the screen?

The 'tower' view is also a candidate, but in this case, I can't figure out how to get it to look at anything other than the plane you're flying.
This is a family-friendly saloon. No talk stink.
Kabuki
 
Posts: 584
Joined: Fri Oct 23, 2009 11:21 pm
Location: Usually on the ground, always in the sky, except when underwater.
Callsign: Kabuki
Version: 3.0.0
OS: Windows 7

Re: Tracking view.

Postby redneck » Tue Sep 20, 2011 10:13 pm

I tried this some time ago too, but I decided to use the ATC aircraft's view. I forget what it was called, but it allows you to cycle through targets. Attaching that view to a moving aircraft turned out to be MUCH more tricky than I could have ever imagined. Perhaps you understand this code better than I do, and could take a look at that. Maybe it will provide what you're looking for.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck
 
Posts: 3617
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240


Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest