Board index FlightGear Development Canvas

Smart Zooming

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Smart Zooming

Postby Hooray » Mon Sep 24, 2012 11:06 am

Most charting/mapping applications will have a fixed number of zoom intervals, i.e. fixed ranges or fixed increments in nautical miles.

If these could be written to the tree, the canvas system would know in advance which zoom ranges are "likely" to occur - so that it could create cached textures in the background, and just use the pre-created texture if the zoom range changes to pre-configured range.

Obviously, that would then not be "lazy" anymore ...so maybe we should support a "render-mode" flag (cached/lazy) ?
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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Smart Zooming

Postby Hooray » Thu Sep 27, 2012 9:50 pm

this could be implemented in a generic fashion at the c++ level for the range/heading properties, where we could specify a range of values (min,max, step) - so that OSG could pre-create the necessary transformations
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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Smart Zooming

Postby zakalawe » Fri Sep 28, 2012 9:51 am

Actually I was hoping to achieve the exact opposite with the canvas - smooth zooming! Probably using the mouse wheel, but essentially supporting a floating zoom level (map range really). This will of course be more CPU intensive than steps - and no possibility to pre-calculate - but I hope that with some other optimisations there's sufficient power to make it work.
zakalawe
 
Posts: 1152
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Smart Zooming

Postby Hooray » Fri Sep 28, 2012 3:23 pm

obviously, that's another opportunity because we use vector images after all ... however, most map displays will have fixed ranges to select from
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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Smart Zooming

Postby TheTom » Fri Sep 28, 2012 4:11 pm

I'd just use the transformation matrix of the map additionally to it's range setting to achieve a smooth zooming. If zooming stays in a certain range then reprojecting everything shouldn't be needed as this, anyhow, wouldn't change something notable (Eg. an airport with its taxiways will always look almost the same booth reprojected as well as just projecting once and afterwards only updating one transformation matrix).
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest