From: James T. <ja...@fl...> - 2018-08-24 12:54:56
|
> On 24 Aug 2018, at 11:26, Kshitij Tiwari <kti...@gm...> wrote: > > First, I want to thank you and Edward for such a quick response !! > > As you suggested, I would like to start off with a smaller project to get my bearings. > I'd love to work on Canvas as I am quite interested in Computer Graphics, though I wouldn't mind working on any of the smaller TerraGear stuff if required. > > Eagerly awaiting your response ! Okay, the ideal smaller projects I would recommend: - replace the HUD (HUD.cxx and related code) with a Canvas implementation. This is a confusing scheme, since we have ‘old’ and ‘new’ C++ HUDs (but I recall I unified their rendering some years ago), and some aircraft already using ‘custom Canvas HUDs’, i.e totally independent of the ‘built-in’ HUD. To be clear, this is the HUD you get by pressing ‘h’ key in the sim. It’s configured by an XML file: FG_DATA/Huds/default.xml - and you can see in that directory, other configs are possible - the ‘new C++ HUD’ layer allows arbitrary placement of HUD elements defined by these XML. *Some* aircraft, but I don’t know how many, use the C++ HUD system, but replace the default HUD with their own - see the F16 example file also in FG_DATA/Huds for example. The aim would be to replace the C++ code with a Nasal HUD layer, likely in FG_DATA/Canvas/Hud - with one Canvas HUD item per each of the current C++ HUD items (ladder, tape, dial etc). Each one should be fairly easy to build with some path, text and group commands. Then we need to write an XML loader in Nasal, possibly one line of C++ to trigger loading, and we can remove the C++ HUD code in favour of the Canvas implementation. Of course, probably it’s not so simple but this is the concept! Oh, and there is some complexity I guess about how the Canvas-for-the-HUD is positioned, since right now the HUD moves when the view is rotated. I guess / hope the existing Canvas HUDs can show how to handle that correctly. - mapping 2D panels to the Canvas. For this I have partial C++ code written, because I believe it’s easier done in C++ than Nasal due to how the 2D panels work. I can share my WIP branch with you. It’s a very similar idea: map the old 2D panel code which uses raw OpenGL calls, to instead build up Canvas items (textures, transforms, text) and update them. Some things are easier here by using C++ - we can keep the same XML parser and the texture loading is much simpler. In both cases the aim is to remove legacy OpenGL 1.x code, since these are some of the awkward remaining pieces. I’m sure these explanation leave out some information, so please do ask if you want to work on these. Of course they are not quite such fun as maybe some other ideas, so please only take them as suggestions. Kind regards, James |