Transcript
Page 1: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Open Inventor

A short introduction

Page 2: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Capabilities of Open Inventor

Easy construction of 3D scenesUser interactionAnimation

Page 3: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Overview

Open Inventor is a “scenegraph“ graphics API: All visible objects are stored in a scenegraphBuilt on top of OpenGL

Page 4: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Scenegraph Anatomy

There are three kinds of nodes: Group nodes: allow construction of

trees Property nodes: change the color /

location / ... of the next object Shapes: visible objects

Page 5: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Common node types

Group nodes SoGroup SoSeparator, SoSwitch, ...

Property nodes Transform: SoTransform, SoRotation, ... Appearance: SoMaterial, SoDrawStyle, ...

Shape nodes SoShape SoCone, SoCube, SoText2, ...

Page 6: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Scene objects

class name prefix: So (scene object)derived from SoNodecan be inserted directly into the scenegraph

Example:root->addChild(new SoSphere)

Page 7: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Fields

class name prefix: SoSF/SoMF (Single Field/Multiple Field)

public attributes of Scene objectsspecify the appearance of scene

objects (like radius, height, color ...)

Page 8: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

... Fields

Newly created scene Objects have fields with default valuesFields can be “connected“ to other fieldsFields can be changed using setValue(s):

Example:SoSphere *sphere = new SoSphere;...sphere->radius.setValue(3);

Page 9: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Typical Open Inventor code...

SoSeparator *root = new SoSeparator;

SoTranslation *t = new SoTranslation;

t->translation.setValue(2, 0, 0);

root->addChild(t);

root->addChild(new SoCube);

...

Page 10: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Loading Scenes

Loading scenes is very easy:

SoInput scene;

scene.openFile("chessboard.iv");

root = SoDB::readAll(&scene);

Page 11: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Advanced Topics

Manipulators allow the user to modify the sceneActions compute bounding boxes, picks objects ...Sensors can detect changes in the scene and invoke callback functionsEngines can animate the scene

Page 12: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

A few tips...

Follow the setup tutorial for Coin3D!You need a new So... class? You need a new #include statement!Don‘t forget to insert your nodes into the scene graph!

Page 13: Open Inventor A short introduction. Capabilities of Open Inventor Easy construction of 3D scenes User interaction Animation

Resources

Coin3D: A free implementation of Open Inventor www.coin3d.orgInventor Mentor: A good online reference bookAnother presentation: http://vrlab.postech.ac.kr/vr/gallery/edu/vr/openinventor.pptdev-gallery: Some simple tutorials www.dev-gallery.com/programming/openInventor/main.html


Recommended