www2 wrote in Sat Oct 17, 2015 10:29 am:Hooray i mean render camera views in canvas (e.g. tail cam in a aircraft)
believe it or not, I actually answered that one above
tail cams are slaved cameras, so could be using code that already exists in FG, which would need to be integrated with the Canvas system, to be exposed as a dedicated Canvas element (kinda like the view manager rendering everything to a texture/osg::Geode).
There's window setup/handling code in CameraGroup.cxx which sets up these slaved views and renders the whole thing to a osg::TextureRectangle, which is pretty much what needs to be extracted and integrated with a new "CanvasCamera" element - the boilerplate for which can be seen at: http://wiki.flightgear.org/Canvas_Devel ... ew_Element
So the CameraGroup code is in $FG_SRC/Viewer/CameraGroup.cxx, where you can find a buildCamera() routine that builds a camera using a property node read from an XML file, as per $FG_ROOT/Docs/README.multiscreen: http://sourceforge.net/p/flightgear/fli ... p.cxx#l798
The whole RTT/FBO texture setup can be seen here: http://sourceforge.net/p/flightgear/fli ... p.cxx#l994
That code would be redundant in the Canvas context, i.e. could be replaced by a Canvas FBO instead.
The next step would then be wrapping the whole thing in a CanvasCamera and exposing the corresponding view parameters as properties (propertyObject) so that slaved cameras can be controlled via Canvas.
Otherwise, there is only very little else needed, because the CanvasMgr would handle updating the Camera, and render everything to the texture that you specified.