20,741
edits
mNo edit summary |
m (+animations) |
||
| Line 14: | Line 14: | ||
People are invited to test these ideas/patches and get involved in developing these further, even if just by helping update the wiki accordingly. | People are invited to test these ideas/patches and get involved in developing these further, even if just by helping update the wiki accordingly. | ||
== CanvasAnimation == | |||
Animations are currently not handled by any Canvas/OSG code directly - instead, Nasal callbacks (using timers and listeners) are used to emulate animations. | |||
However, this is relatively expensive - on the one hand because it is using Nasal to update scene graph related data structures, and on the other hand because the resulting scenegraph itself is relatively low-level, i.e. OSG does not even know that the scenegraph is used for implementing an animation. | |||
In other words, most Nasal code currently used to update Canvas elements/textures is basically about "animating" child nodes using Nasal callbacks, which is reflecting badly upon Canvas based features, because of the massive performance overhead due to all the required Nasal code. | |||
On the other hand, OSG does provide built-in APIs to provide support for various kinds of animations, so it would make sense to expose this at the Canvas::Element level, so that people using Canvas to implement animations can stop using Nasal, and instead use native OSG code. | |||
The de-facto reference are the animation related child classes inheriting from osg::Group: http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00357.html | |||
Specifically, these are: | |||
* osg::Switch - to enable/disable a node: http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00823.html | |||
* osg::Sequence - automatic, time-based switching between child nodes: http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00733.html | |||
* osg::MultiSwitch - switching between child nodes: http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00515.html | |||
Using just these three APIs, we can come up with a single Canvas::Animation class that supports all important animations, without going through Nasal space unnecessarily. | |||
In addition, it would be possible to map animation callbacks to property rules to use C++ instead of Nasal for more sophisticated purposes. | |||
{{Custom_Canvas_Element | |||
|baseclass=Element | |||
|elementName=Animation | |||
|elementTitle=Canvas Animation support | |||
|description=Stub for exposing OSG animation support as a dedicated Canvas element | |||
}} | |||
== CanvasShapefile == | == CanvasShapefile == | ||