Canvas SVG parser: Difference between revisions

m
(Remove some old stuff...)
Line 3: Line 3:
=== Vector Image Support ===
=== Vector Image Support ===


The SVG parser basically just maps the xml structure to the property tree. It is implemented in Nasal on top of the XML parsing facilities alread provided by FlightGear. Using separate canvas elements instead of a single image will always be slower as every little piece of the canvas hat to be triangulated and afterwards rendered every time the canvas gets updated instead of just copying an image. On the other hand you if you use the canvas you can dynamically update the contents of the image and also get (theoretically) unlimited resolution, even changeable at runtime. For SVG already existing tools (Inkscape) can be used to create images and then just load them via Nasal and add some dynamic features to them.
The SVG parser basically just maps the xml structure to the property tree. It is implemented in Nasal on top of the XML parsing facilities already provided by FlightGear. Using separate canvas elements instead of a single image will always be slower as every little piece of the canvas hat to be triangulated and afterwards rendered every time the canvas gets updated instead of just copying an image. On the other hand you if you use the canvas you can dynamically update the contents of the image and also get (theoretically) unlimited resolution, even changeable at runtime. For SVG, already existing tools (Inkscape) can be used to create images and then just load them via Nasal and add some dynamic features to them.


<!-- Integration-wise, there are some lessons to be learnt from the way SMIL works via SVG and ECMAScript (JavaScript). -->
<!-- Integration-wise, there are some lessons to be learnt from the way SMIL works via SVG and ECMAScript (JavaScript). -->