Howto:Use a Camera View in an Instrument: Difference between revisions

Jump to navigation Jump to search
m
Line 1: Line 1:
=Objective=
=Objective=


To create a 2D instrument which shows a camera view. The steps involved in creating such an instrument would be:
To create a 2D instrument which shows a camera view. Write C++ code, preferably an instrument that renders a Camera View (i.e. from the property tree) to a texture.
* Write a C++ Function, preferably an instrument that renders a Camera View (i.e. from the property tree) to a texture.
 
* Write an XML 2D Instrument file that displays the texture (Zan has already code doing this sort of thing [http://flightgear.org/forums/viewtopic.php?f=6&t=13798])
The steps involved in creating such an instrument would be:*
* Also, the OD_Gauge instrument is the instrument that needs to be implemented here
 
* create a new topic branch: [[FlightGear and Git#Local_Branch]]
* Add a new set of cxx/hxx files to $FG_SRC/Instrumentation/ (e.g. camera-texture.cxx and camera-texture.hxx): to get started quickly, just copy and customize the gyro.* files
* implement the SGSubsystem interface for the new subsystem [http://simgear.sourceforge.net/doxygen/classSGSubsystem.html]
* add the new files to the CMake build system: [[Developing using CMake#Adding_new_files_to_the_build]]
* add the new subsystem to the instrument_mgr (FGInstrumentMgr::build method)[http://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/instrument_mgr.cxx#line127]
* implement the interface for the od_gauge instrument [http://gitorious.org/fg/flightgear/blobs/next/src/Instrumentation/od_gauge.cxx] to dynamically create a texture and display update it as a cockpit instrument
* implement SGPropertyChangeListener to process property tree events and updates [http://simgear.sourceforge.net/doxygen/classSGPropertyChangeListener.html]
* Render a property-driven camera view to the created texture (Zan has already code doing this sort of thing [http://flightgear.org/forums/viewtopic.php?f=6&t=13798])
* Write an XML 2D Instrument file that displays the texture




Navigation menu