Canvas sandbox: Difference between revisions

Jump to navigation Jump to search
m
Line 55: Line 55:
|description=Stub for exposing OSG animation support as a dedicated Canvas element  
|description=Stub for exposing OSG animation support as a dedicated Canvas element  
}}
}}
==CanvasShape ==
[[File:Exposing-osgShape as a dedicated canvas element.png|thumb|Screen shot showing a custom canvas element wrapping osg::Shape]]
As a simple proof-of-concept, we can begin by exposing osg::Shape as a dedicated Canvas element:
<syntaxhighlight lang="cpp">
osg::Shape* sphere = new osg::Sphere(osg::Vec3(10.0f, 10.0f, 10.0f), 5.0f);
osg::ShapeDrawable* sphereDrawable = new osg::ShapeDrawable(sphere);
osg::Geode* sphereGeode = new osg::Geode();
sphereGeode->addDrawable(sphereDrawable);
</syntaxhighlight>
* http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00753.html
* https://www.artoolworks.com/support/library/Basic_Shapes
* http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/TransformsAndStates
* http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/BasicGeometry
* http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgshape/osgshape.cpp


== CanvasShapefile ==
== CanvasShapefile ==

Navigation menu