An open source framework for graphical related tasks
Clément Forest Digital-Trainers www.digital-trainers.com
An open source framework for graphical related tasks Clment Forest - - PowerPoint PPT Presentation
An open source framework for graphical related tasks Clment Forest Digital-Trainers www.digital-trainers.com VgSDK in short External dependencies Supported hardware Base principles The user describes the objects in a scene graph The
Clément Forest Digital-Trainers www.digital-trainers.com
The world is described as an
(DAG) The engine exposes a state and update it during the graph traversal
Root
Setup
Camera
Drawstyle
Scene
Object 1 Material Geometry Object 2
Material
Geometry
Specialised components (aspects) use that state to do their respective tasks (OpenGL rendering, scene manipulation, bounding boxes computation, ...)
core
vgBase, vgd, vgDebug, vgm
engines
vge, vgBullet, vgeGL
ui
vgUI, vgGTK, vgQt, vgSDL, vgWx
io
vgio, vgPhysfs, vgOpenAssetImport, vgTrian
algorithms
vgAlg
images
vgCairo, vgFFmpeg vgITK
2003 2008 2010 2004 2014
Shp< Program > program = Program::create( "myShader" ); program->setVertex( "....." ); program->setFragment( "....." );
Negatoscope 2D and 3D Patient reconstruction
Ultrasound simulation Surgical planning
GeoMorph ...)
(VertexShape, Box, Quad, Grid, ...)
(Dragger, ...)
vgd::Shp< vgd::node::Material> material = vgd::node::Material::create("redMaterial");
vgd::Shp< Group > group = Group::create( "rootOfScene" );
group->addChild( material )
vgd::Shp< Material > m = group->getChild<Material>(0);
result = findFirstByType<VertexShape>(); result = findFirstByRegex("tumor.*");
refresh( REFRESH_IF_NEEDED, ASYNCHRONOUS ); refresh( REFRESH_FORCED, SYNCHRONOUS );
hitNode = castRay(xMousePosition, yMousePosition); HotNode = castRay(raySource, rayDirection, outputHitTriangle)
light1 = DirectionalLight::create("light1");
light1->setOn( false );
light1->setDirection( vgm::Vec3f(0,0, -1) );
light2 = SpotLight::create("light2", 1/*light index*/);
light2->setOn(true); light2->setPosition( vgm::Vec3f(0,0, 5) ); light2->setDirection( vgm::Vec3f(0,0, -1) ) light2->setCastShadow( true );
node->addField( newField );
EditorRO<FieldType > editorRO = getFieldRO(name)
EditorRW<FieldType > editorRW = getFieldRW(name)
vgOpenAssetImport::Loader loader; Shp< VertexShape > shape = loader.load( filename );
EditorRW< TMultiField< Vec3f > > editor_pos = shape->getVertexRW(); EditorRW< TMultiField< unsigned long > > editor_ind = shape->getVertexIndexRW(); EditorRW< TMultiField< Primitive > > editor_pri = shape->getPrimitiveRW();
// Enables phong tessellation tessProp->setTessellation( TessellationProperties::PHONG ); // Specifies the minimum (1) and maximum (32) tessellation level used by the tessellation control shaders to tessellate the incoming primitive. tessProp->setRange( vgm::Vec2f(1.f, 32.f) ); // When tessellation method is set to PHONG and TessellationLevel.method==PIXELS_PER_EDGE, then this field specifies the desired number of pixels per edge tessProp->setPixelsPerEdge( 15.f ); // Chooses adaptive tessellation using the number of pixels per edge desired as criterion tessLevel->setMethod( TessellationLevel::PIXELS_PER_EDGE );