Board index FlightGear Development New features

Alternative camera control

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

Re: Alternative camera control

Postby punkepanda » Fri Jan 10, 2014 10:11 pm

Great script. It make flying a bit more sensational.
Try to make so that camera move harder the more speed you get on the runway. It starts full motion effect on even low speed.


To set the camera start position for other aircraft, edit Aircraft/YOURAIRCRAFT/fgcamera/pilot.xml
Then change x, y, z offsett-m to your aircrafts pilot seat.

Below is for the 777. U need to change whats in BOLD
<config>
<internal type="bool">1</internal>
<x-offset-m type="double">-0.549</x-offset-m>
<y-offset-m type="double">0.830</y-offset-m>
<z-offset-m type="double">-28.050</z-offset-m>

<heading-offset-deg type="double">0.0</heading-offset-deg>
<heading-offset-deg type="double">0.0</heading-offset-deg>
<pitch-offset-deg type="double">-10</pitch-offset-deg>
<roll-offset-deg type="double">0.0</roll-offset-deg>
<RND type="bool">1</RND>
<DHM type="bool">1</DHM>
<PTP type="bool">1</PTP>
<CR type="bool">0</CR>
<ML type="bool">0</ML>
<keyboard-filter type="double">1.0</keyboard-filter>
<mouse-filter type="double">0.1</mouse-filter>
<linear-velocity-m_s type="double">0.2</linear-velocity-m_s>
<angular-velocity-deg_s type="double">30.0</angular-velocity-deg_s>
</config>

BTW is this gonna be integrated for V3.0?

Possible to have it work with the mouse like the original viewer?
punkepanda
 
Posts: 237
Joined: Mon Nov 04, 2013 9:11 pm
Callsign: LostFlight
Version: 2.12
OS: Arch Linux

Re: Alternative camera control

Postby HelldiverSquadron » Sat Jan 25, 2014 11:25 pm

User avatar
HelldiverSquadron
 
Posts: 393
Joined: Sat Feb 16, 2013 6:35 pm
Callsign: Friend
Version: 3.0
OS: Windows 7 Ultimate

Re: Alternative camera control

Postby masnormen » Thu Mar 06, 2014 7:36 am

Any tutorial to implement this to other aircraft? Or, any update?
User avatar
masnormen
 
Posts: 11
Joined: Thu Jul 04, 2013 11:48 am
Callsign: normen
Version: 3.0
OS: Arch Linux x64

Re: Alternative camera control

Postby Marius_A » Thu Mar 06, 2014 12:07 pm

masnormen wrote in Thu Mar 06, 2014 7:36 am:Any tutorial to implement this to other aircraft? Or, any update?

The next version of FGcamera will have graphical user interface and will automatically implement itself to any aircraft.
Current version of the script has several errors and the way used to implement it to other aircraft is not practical (too much data to reliably manage it manually).
Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: Alternative camera control

Postby masnormen » Thu Mar 06, 2014 12:29 pm

Marius_A wrote in Thu Mar 06, 2014 12:07 pm:
masnormen wrote in Thu Mar 06, 2014 7:36 am:Any tutorial to implement this to other aircraft? Or, any update?

The next version of FGcamera will have graphical user interface and will automatically implement itself to any aircraft.
Current version of the script has several errors and the way used to implement it to other aircraft is not practical (too much data to reliably manage it manually).


Well, that'd be nice! When is the estimated date of the release of the next version of FGCamera?
User avatar
masnormen
 
Posts: 11
Joined: Thu Jul 04, 2013 11:48 am
Callsign: normen
Version: 3.0
OS: Arch Linux x64

Re: Alternative camera control

Postby HelldiverSquadron » Thu Mar 06, 2014 4:35 pm

Nice! Can't wait!
User avatar
HelldiverSquadron
 
Posts: 393
Joined: Sat Feb 16, 2013 6:35 pm
Callsign: Friend
Version: 3.0
OS: Windows 7 Ultimate

Re: Alternative camera control

Postby Hooray » Thu Mar 06, 2014 5:15 pm

I added a new article to the wiki for FGCamera, please feel free to add to, and maintain, it: http://wiki.flightgear.org/FGCamera
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: 11738
Joined: Tue Mar 25, 2008 8:40 am

Re: Alternative camera control

Postby Marius_A » Thu Mar 13, 2014 4:53 pm

Improved random camera movement:
Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: Alternative camera control

Postby hamzaalloush » Thu Mar 13, 2014 10:02 pm

is your latest change reflected in the downloadable link?

this is what my joystick code look like, after i assigned the top hat for the x-52 for alternative camera:

Code: Select all

<button n="5"> # Pinkie Button for shift
<desc>Shift switch for X52</desc>
<binding>
   <command>nasal</command>
   <script>modifier.setBoolValue(1)</script>
</binding>
<mod-up>
<binding>
   <command>nasal</command>
   <script>modifier.setBoolValue(0)</script>
</binding>
</mod-up>
</button>

<button n="19">
     <desc>Camera Up; Shift: Camera Foreward</desc>
     <binding>
     <command>nasal</command>
     <script>
       <![CDATA[
         if (modifier.getValue()) {fgcamera.point.adjust("z", -1);}
         else {fgcamera.point.adjust("y", 1);}
       ]]>
     </script>
   </binding>
   <mod-up>
   <binding>
     <command>nasal</command>
          <script>
       <![CDATA[
         if (modifier.getValue()) {fgcamera.point.adjust("z", 0);}
          else {fgcamera.point.adjust("y", 0);}
       ]]>
     </script>
   </binding>
   </mod-up>
</button>

<button n="20">
     <desc>Camera Right</desc>
     <binding>
     <command>nasal</command>
     <script>fgcamera.point.adjust("x", 1);</script>
   </binding>
   <mod-up>
   <binding>
     <command>nasal</command>
          <script>fgcamera.point.adjust("x", 0);</script>
   </binding>
   </mod-up>
</button>

<button n="21">
     <desc>Camera Down; Shift: Camera Back</desc>
     <binding>
     <command>nasal</command>
     <script>
       <![CDATA[
         if (modifier.getValue()) {fgcamera.point.adjust("z", 1);}
          else {fgcamera.point.adjust("y", -1);}
       ]]>
     </script>
   </binding>
   <mod-up>
   <binding>
     <command>nasal</command>
          <script>
       <![CDATA[
         if (modifier.getValue()) {fgcamera.point.adjust("z", 0);}
          else {fgcamera.point.adjust("y", 0);}
       ]]>
     </script>
   </binding>
   </mod-up>
</button>

<button n="22">
     <desc>Camera Left</desc>
     <binding>
     <command>nasal</command>
     <script>fgcamera.point.adjust("x", -1);</script>
   </binding>
   <mod-up>
   <binding>
     <command>nasal</command>
          <script>fgcamera.point.adjust("x", 0);</script>
   </binding>
   </mod-up>
</button>



right now i have Shift + Hatstick Y-axis for foreward/back.
i was wondering if we can have head rotate left/right also.

i can't wait untill we can apply it to all aircraft!

thanks
hamzaalloush
 
Posts: 632
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

Re: Alternative camera control

Postby Johan G » Thu Mar 13, 2014 11:58 pm

My first thoughts on your last video is that when on ground you could more or less ignore lateral accelerations and reduce the effect from longitudinal accelerations. It kind of looks weird that the camera moves almost as much side to side as up and down (though it might have it's place on rougher grass fields). It also looks slightly weird to be hanging in the harness while breaking. Maybe a bit low viewpoint in the end. Otherwise it looks good. :D

It is nice to see that you are still working on this. :D
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: 5691
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: Alternative camera control

Postby flyingfisch » Fri Mar 14, 2014 12:47 am

Is "enable dynamic cockpit view" in "View>Cockpit view options" (flightgear v3.0.0) the same as this, or do we still need to install the script manually?
Beechcraft A35 Bonanza
Wiki Page
GitHub Repo
Improving the 737-300
Forum Thread
All my projects
User avatar
flyingfisch
 
Posts: 306
Joined: Mon Oct 07, 2013 1:11 pm
IRC name: ffisch
Version: 3.0
OS: Ubuntu 12.04

Re: Alternative camera control

Postby Marius_A » Fri Mar 14, 2014 8:27 am

flyingsolo wrote in Thu Mar 13, 2014 10:02 pm:is your latest change reflected in the downloadable link?

Not yet.
<...> i was wondering if we can have head rotate left/right also <...>

Rotating left/right:
Code: Select all
<button n="...">
   <desc> ... </desc>
   <binding>
      <command>nasal</command>
      <script>fgcamera.point.adjust("h", -1);</script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>fgcamera.point.adjust("h", 0);</script>
      </binding>
   </mod-up>
</button>

<button n="...">
   <desc> ... </desc>
   <binding>
      <command>nasal</command>
      <script>fgcamera.point.adjust("h", 1);</script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>fgcamera.point.adjust("h", 0);</script>
      </binding>
   </mod-up>
</button>

Rotating up/down:
Code: Select all
<button n="...">
   <desc> ... </desc>
   <binding>
      <command>nasal</command>
      <script>fgcamera.point.adjust("p", -1);</script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>fgcamera.point.adjust("p", 0);</script>
      </binding>
   </mod-up>
</button>

<button n="...">
   <desc> ... </desc>
   <binding>
      <command>nasal</command>
      <script>fgcamera.point.adjust("p", 1);</script>
   </binding>
   <mod-up>
      <binding>
         <command>nasal</command>
         <script>fgcamera.point.adjust("p", 0);</script>
      </binding>
   </mod-up>
</button>

Johan G wrote in Thu Mar 13, 2014 11:58 pm: <...> when on ground you could more or less ignore lateral accelerations and reduce the effect from longitudinal accelerations. It kind of looks weird that the camera moves almost as much side to side as up and down (though it might have it's place on rougher grass fields). It also looks slightly weird to be hanging in the harness while breaking <...>

Correct. The dynamic head movement calculations is currently over-simplified and will be improved as well.
flyingfisch wrote in Fri Mar 14, 2014 12:47 am:Is "enable dynamic cockpit view" in "View>Cockpit view options" (flightgear v3.0.0) the same as this, or do we still need to install the script manually?

The script still should be installed manually. Currently, the "enable dynamic cockpit view" option should be disabled if you use fgcamera (to avoid two modules trying to change the value of the same property).
Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: Alternative camera control

Postby Marius_A » Sun Mar 16, 2014 11:49 am

Using random camera efects to trigger sound effects:

Marius_A
 
Posts: 89
Joined: Wed Dec 04, 2013 2:20 pm

Re: Alternative camera control

Postby Hooray » Sun Mar 16, 2014 12:35 pm

Using random camera efects to trigger sound effects

that's looking pretty good - we could extend the flight recorder/replay dialog so that camera views can be linked to certain segments of the flight - we would only need to link custom camera views to certain time offsets.
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: 11738
Joined: Tue Mar 25, 2008 8:40 am

Re: Alternative camera control

Postby hamzaalloush » Thu Mar 27, 2014 10:27 pm

hi Marius_A,

i want to make a joystick xml file that is comptabale with fgcamera as well as regular camera. i.e

Code (): Select all
view.panViewPitch()
&
Code (): Select all
view.panViewDir()


how can i achieve this, can you lead me in the right direction?

i tried this joystick code but i cannot get it to work perfectly.(pan is not repeatable, and only one direction seems to make pan change persistant)




Code: Select all

var fgcamerastart = fgcamera.camera.started; #check if fgcamera avaliable for aircraft


<axis n="8">
<desc>View Elevation</desc>
<repeatable>true</repeatable>
<binding>
         <command>property-scale</command>
         <property>/data/hat-V</property>
         <factor type="double">-1.0</factor>
</binding>

<binding>   
<command>nasal</command>
<script>


<![CDATA[
var hat_V = getprop("/data/hat-V");
if(fgcamerastart == 1)
{
fgcamera.point.adjust("p", hat_V);
}
else
               if(hat_V>0)
      {
          view.panViewPitch(1);   
      }
          else
      {
          view.panViewPitch(-1);
      }
]]>


</script>
</binding>
</axis>
hamzaalloush
 
Posts: 632
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

PreviousNext

Return to New features

Who is online

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