Board index FlightGear Development Aircraft

Cockpit view problems

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Cockpit view problems

Postby wlbragg » Mon Jul 03, 2017 7:48 am

I'm having trouble with the AirCrane cockpit views.
One problem is I can't get it to cycle through the views correctly. It starts at 0 but cycles through to 10 and then back to 1, skipping 0. I have checked and double checked the view definitions against a few other aircraft and don't see anything wrong. I can set the current-view-number to 0 and that works, but it wont cycle to 0.

The other issue is I am getting weird views for model and flyby. I have seen these strange views on other aircraft but I could say which ones or if they were the same view assignment.

I'm hoping someone will see something I am overlooking or knows what the issue might be.

Current code for the views
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

  <chase-distance-m type="double" archive="y"> -30 </chase-distance-m>

  <view n="0">
    <internal type="bool" archive="y">true</internal>
    <config>
      <x-offset-m archive="y" type="double">  0.520 </x-offset-m> <!--right-->
      <y-offset-m archive="y" type="double"> -1.091 </y-offset-m> <!--up-->
      <z-offset-m archive="y" type="double"> -8.668 </z-offset-m> <!--back-->
      <pitch-offset-deg type="double"> -15 </pitch-offset-deg>
      <default-field-of-view-deg> 60 </default-field-of-view-deg>
    </config>
  </view>

  <view n="100">
    <name>Passanger Seat View</name>
    <type>lookfrom</type>
    <internal archive="y">true</internal>
    <config>
      <!--dynamic-view type="bool">true</dynamic-view-->
      <from-model type="bool">true</from-model>
     <from-model-idx type="int">0</from-model-idx>
      <ground-level-nearplane-m type="double">0.5f</ground-level-nearplane-m>
      <x-offset-m archive="y" type="double"> -0.520 </x-offset-m> <!--right-->
      <y-offset-m archive="y" type="double"> -1.091 </y-offset-m> <!--up-->
      <z-offset-m archive="y" type="double"> -8.668 </z-offset-m> <!--back-->
      <pitch-offset-deg type="double"> -15 </pitch-offset-deg>
      <default-field-of-view-deg> 60 </default-field-of-view-deg>
    </config>
  </view>

  <view n="101">
    <name>Crane Seat View</name>
    <type>lookfrom</type>
    <internal archive="y">true</internal>
    <config>
      <!--dynamic-view type="bool">true</dynamic-view-->
      <from-model type="bool">true</from-model>
     <from-model-idx type="int">0</from-model-idx>
      <ground-level-nearplane-m type="double">0.5f</ground-level-nearplane-m>
      <x-offset-m archive="y" type="double"> -0.575 </x-offset-m> <!--right-->
      <y-offset-m archive="y" type="double"> -1.665 </y-offset-m> <!--up-->
      <z-offset-m archive="y" type="double"> -7.735 </z-offset-m> <!--back-->
      <pitch-offset-deg type="double"> 0 </pitch-offset-deg>
      <default-field-of-view-deg> 60 </default-field-of-view-deg>
      <heading-offset-deg type="double">180</heading-offset-deg>
    </config>
  </view>

  <view n="102">
    <name>Tail Camera View</name>
    <type>lookfrom</type>
    <internal archive="y">true</internal>
    <config>
      <from-model type="bool">true</from-model>
      <from-model-idx type="int">0</from-model-idx>
      <ground-level-nearplane-m type="double">0.01f</ground-level-nearplane-m>
      <x-offset-m archive="y" type="double">  0.000 </x-offset-m> <!--Right-->
      <y-offset-m archive="y" type="double">  1.801 </y-offset-m> <!--Up-->
      <z-offset-m archive="y" type="double"> 10.637 </z-offset-m> <!--Back-->
      <pitch-offset-deg> -5 </pitch-offset-deg>
      <default-field-of-view-deg type="double"> 30 </default-field-of-view-deg>
    </config>
  </view>

</PropertyList>


These are the strange views for
Flyby view=6
Image

Model view=7
Image
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Cockpit view problems

Postby sanhozay » Mon Jul 03, 2017 8:45 am

Have you got the compensate view for wide screens set?

If so, what happens if you uncheck that option and restart Flightgear?

I think the default field of view tag is the problem. Without a type defined, and with spaces inside the tag, the number is interpreted as a string and you get problems like this.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 11:57 am
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Cockpit view problems

Postby wlbragg » Mon Jul 03, 2017 11:17 am

Interesting, "compensate view for wide screens" was the cause for the strange view modes but not the rolling back to view = 0. I tried type defining all the tags and removing the spaces but it still wont go back to 0.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Cockpit view problems

Postby sanhozay » Mon Jul 03, 2017 12:17 pm

I expected it to fix the strange views but the inability to cycle through view zero is a new one on me.

Does this work?

Code: Select all
  <view n="0">
    <name>Cockpit</name>
    <type>lookfrom</type>
    <internal type="bool">true</internal>
    <config>
      <x-offset-m type="double"> 0.520</x-offset-m>
      <y-offset-m type="double">1.801</y-offset-m>
      <z-offset-m type="double">10.637</z-offset-m>
      <pitch-offset-deg>-5</pitch-offset-deg>
      <field-of-view type="double">30.0</field-of-view>
      <default-field-of-view-deg type="double">30.0</default-field-of-view-deg>
      <from-model type="bool">true</from-model>
      <from-model-idx type="int">0</from-model-idx>
    </config>
  </view>

Have you looked under "/sim/view[0]" in the property tree to see what it's doing?

wilbragg wrote:I have seen these strange views on other aircraft but I could [not] say which ones

It's pretty much everything from Helijah's hangar because they have the same default field of view tag with no type and spaces. I did email him about it.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 11:57 am
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Cockpit view problems

Postby wlbragg » Mon Jul 03, 2017 7:10 pm

Thanks for the help @sanhozay

The issue is "/sim/view[0]"/enabled is set to false.
As soon as I set that to true it works and cycles through back to 0. So I guess I need to do some code searching and figure out where or why that is being set to false.

Thanks again for your help.

Late edit:
It is really nice to have these views back. The code had several useful views coded but commented out. I am restoring those views. The "Crane Operator View" will be really nice to have once there is a working auto hover or position hold of some sort. Plus it is really nice to have a "Cockpit View".

The AirCrane has long been my favorite helicopter. I really like the FDM on it and how easy it is to control. Perfect for equipping it with optional features like Bambi-bucket and cargo towing. My eventual goal is to make it fully functional for these things and also get all the instrumentation installed.

The other thing I would really like to see is a JSBSim version of the FDM. Mainly for the ability to use all the coding feature you get with JSBSim. As is, the YASim FDM is really user friendly though and in my opinion, really well done.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Cockpit view problems

Postby wlbragg » Tue Jul 04, 2017 8:56 pm

The issue is "/sim/view[0]"/enabled is set to false.


Really strange, once I manually set this value to true the views are working appropriately. I'm confused as to how that ever got set to false and why a clearing of the aircrafts cached data didn't resolve it? Now that I manually set it to true, "one time", even a restart keeps it true. I guess I don't understand the whole cache system of FG.

One other question I have is, what is the difference between dynamic view and not dynamic view in regards to the view management?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Cockpit view problems

Postby wkitty42 » Tue Jul 04, 2017 9:57 pm

a static view would be the same all the time, AFAIK... a dynamic one would change...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5721
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Cockpit view problems

Postby wlbragg » Tue Jul 04, 2017 10:55 pm

Well what doest that mean in the context of the view code, ie:

Code: Select all
<view n="100">
    <name>Passanger Seat View</name>
    <type>lookfrom</type>
    <internal archive="y">true</internal>
    <config>
      <!--dynamic-view type="bool">true</dynamic-view-->
      <from-model type="bool">true</from-model>
     <from-model-idx type="int">0</from-model-idx>
      <ground-level-nearplane-m type="double">0.5f</ground-level-nearplane-m>
      <x-offset-m archive="y" type="double"> -0.520 </x-offset-m> <!--right-->
      <y-offset-m archive="y" type="double"> -1.091 </y-offset-m> <!--up-->
      <z-offset-m archive="y" type="double"> -8.668 </z-offset-m> <!--back-->
      <pitch-offset-deg type="double"> -15 </pitch-offset-deg>
      <default-field-of-view-deg> 60 </default-field-of-view-deg>
    </config>
  </view>


What does enabling the commented out "dynamic-view" tag actually do?

Is it maybe you can't use the mouse to change that view when in it or something else?

I haven't actually tested it.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Cockpit view problems

Postby Johan G » Sun Aug 06, 2017 8:58 am

IIRC the dynamic view is when it is set to change due to g forces (in essence shake due to turbulence and move due to maneuvering). I think it can be enabled and disabled in the cockpit view options dialog. I might be wrong though.
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: 5537
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: Cockpit view problems

Postby wlbragg » Sun Aug 06, 2017 8:43 pm

Thank you Johan, make total sense now.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4929
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640


Return to Aircraft

Who is online

Users browsing this forum: Google [Bot] and 1 guest