Board index FlightGear Development

Aircraft specific View with type "look at"

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Aircraft specific View with type "look at"

Postby mhab » Mon Jan 05, 2015 7:06 pm

Hello

What I would like to do e.g. is define an aircraft specific view for a helicopter which always looks at the Main Rotor. It should behave in a way that if I change viewing directions the "viewing" position is rotated around the rotor center and not around the viewing position (like it is for "lookfrom" type views). In addition it should rotate around the rotorhead and not around the model center.

I experimented with some parameters and offsets in the view definition, but just don't seem to get result I want.
In some cases I had really weird view movements and I was never able to center the view somewhere off the model-center.

Remark: The docu in the Wiki is a bit limited, as it doesn't really seem to explain the philosophy behind the implementation ...
or I am using too many different sims and am no more fully FG compatible ;-)

Mike-DE
mhab
 
Posts: 418
Joined: Thu Apr 18, 2013 11:59 pm
Callsign: D-MIKE
Version: 2020.3.4
OS: Win10

Re: Aircraft specific View with type "look at"

Postby mhab » Mon Jan 05, 2015 8:20 pm

Hello

It seems posting in the forum helps to find the solution ... meanwhile I found the settings I was looking for:

Code: Select all
    <view n="109">
      <name>Rotor Camera View</name>
      <type>lookat</type>
      <internal type="bool">false</internal>
      <config>
            <from-model type="bool">true</from-model>
            <from-model-idx type="int">0</from-model-idx>

            <at-model type="bool">true</at-model>
            <at-model-idx type="int">0</at-model-idx>

            <target-y-offset-m type="double"> 1.5</target-y-offset-m>
            <target-z-offset-m type="double">-2.0</target-z-offset-m>

        <default-field-of-view-deg type="double">50</default-field-of-view-deg>
        <pitch-offset-deg>0</pitch-offset-deg>

        <x-offset-m archive="y"> 0.000 </x-offset-m> <!--Right-->
        <y-offset-m archive="y"> 0.000 </y-offset-m> <!--Up   -->
        <z-offset-m archive="y">-3.000 </z-offset-m> <!--Back -->

      </config>
      <enabled type="bool">true</enabled>
    </view>

This view is centered at the position defined by target-*-offset-m and the viewer is placed at *-offset-m relative to the target.
Movements behave as expected and move/rotate the view relative to target position.

Thanks (to myself in this case)
Mike-DE
mhab
 
Posts: 418
Joined: Thu Apr 18, 2013 11:59 pm
Callsign: D-MIKE
Version: 2020.3.4
OS: Win10


Return to Development

Who is online

Users browsing this forum: No registered users and 10 guests