Open Inventor Programming - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Open Inventor Programming

Description:

With Open Inventor, the ability to make these changes is built into the programming model. ... Node Kits. Example: SoShapeKit. Used for any inventor shape object. ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 28
Provided by: cse5
Category:

less

Transcript and Presenter's Notes

Title: Open Inventor Programming


1
Open Inventor Programming
  • Beifang Yi
  • 2004 July

2
Open Inventor Programming
  • Based on the following references
  • Orange Book(Inventor Mentor)
  • Coin3d On-line Document(http//doc.coin3d.org)
  • Green Book(Inventor Manual)
  • Red Book(OpenGL Programming)
  • Purple Book (Inventor Toolmaker)

3
Open Inventor Programming
  • Without mentioning to the reference source, the
    contents are assumed to come from the Orange
    Book The Inventor Mentor, Programming
    Object-Oriented 3D Graphics with Open Inventor,
    Release 2.

4
1. Overview
  • What is Open Inventor?
  • Open Inventor is a library of objects and methods
    used to create interactive 3D graphics
    applications.
  • Inventor objects include
  • database primitives (shape, property, group, and
    engine objects),
  • interactive manipulators (handle box and
    trackball),
  • and components (material editor, directional
    light editor, and examiner viewer).

5
1. Overview
  • What is Open Inventor?
  • Inventor architecture

6
1. Overview
  • What is Open Inventor?
  • Inventor represents an object-oriented
    application policy built on top of OpenGL,
    providing a programming model and user interface
    for OpenGL programs.
  • The Inventor toolkit is window System
    independent.

7
1. Overview
  • Objects, not Drawings
  • Introduction
  • All information about these objects (shape, size,
    coloring, texture, location in 3D space) is
    stored in a scene database.
  • This information can be used in a variety of ways
    -- The most common use is to display (or render)
    an image of the 3D objects on the screen.
  • For many 3D graphics packages, this image is the
    ultimate goal -- a photorealistic representation
    on the screen of a 3D scene.

8
1. Overview
  • Objects, not Drawings
  • Introduction
  • But what if you want to change the scene, or
    interact with it?
  • With Open Inventor, the ability to make these
    changes is built into the programming model.

9
1. Overview
  • Objects, not Drawings
  • Using database objects in a variety of ways
  • Because the Inventor database holds information
    about the objects as they exist in their 3D
    "world" (not just as a 2D array of pixels) other
    operations in addition to rendering can be
    performed.
  • The objects in the scene can be picked,
    highlighted, and manipulated as discrete
    entities.
  • Bounding-box calculations can be performed on
    them.
  • They can be printed, searched for, read from a
    file, and written to a file.

10
1. Overview
  • Animation
  • Inventor Objects can also encapsulate behavior
    into the description stored in the scene database.

11
1. Overview
  • How does Open Inventor Relate to OpenGL?
  • Open Inventor uses OpenGL for rendering.
  • In OpenGL the rendering is explicit, whereas in
    Inventor, rendering (along with other operations)
    is encapsulated in the objects.

12
1. Overview
  • The Inventor ToolKit
  • The Scene Database
  • Node
  • The node is the basic building block to create
    three-dimensional scene databases in Inventor.
  • Each node holds a piece of information (surface
    material, shape description, geometric
    transformation, light, or camera)

13
1. Overview
  • The Inventor ToolKit
  • The Scene Database
  • Scene Graph
  • An ordered collection of nodes is referred to as
    a scene graph.
  • The scene graph is stored in the Inventor
    database.
  • Inventor takes care of storing and managing the
    scene graph in the database .

14
1. Overview
  • Scene Graph Symbols
  • Scene Graph Example

15
1. Overview
  • The Inventor ToolKit
  • The Scene Database
  • Actions
  • After you have constructed a scene graph, you can
    apply a number of operations or actions to it,
    including rendering, picking, searching,
    computing a bounding box, or writing o a file.

16
1. Overview
  • The Inventor ToolKit
  • The Scene Database
  • Classes of database primitives
  • shape nodes sphere, cube, cylinder, quad mesh.
  • property nodes material, lighting model,
    textures, environment
  • group nodes separator, level-of-detail, switch
  • engines provide animation
  • sensors timing based or change based

17
1. Overview
  • The Inventor ToolKit
  • Node Kits
  • Overview
  • Node kits facilitate the creation of structured,
    consistent databases.
  • Each node kit is a collection of nodes with a
    specified arrangement.

18
1. Overview
  • The Inventor ToolKit
  • Node Kits
  • Example SoShapeKit
  • Used for any inventor shape object.
  • If you use this node kit, you don't have to
    create and arrange each node individually.
  • By default it contains an SoCube node, and it
    allows a material, geometric transformation, and
    other properties to be inserted in the correct
    place when required.

19
1. Overview
  • The Inventor ToolKit
  • Node Kits
  • Another use of node kits is to define
    application-specific objects and semantics. For
    example, airplane animation
  • Each airplane consists of the same general scene
    graph structure fuselage, wings, and landing
    gear.
  • As well as some airplane-specific methods
    BankLeft(), RaiseLandingGear().
  • There is no need to know the structure of the
    subgraph representing the landing gear to raise
    it, since the general method, RaiseLandingGear(),
    exists.

20
1. Overview
  • The Inventor ToolKit
  • Manipulators
  • A special kind of node that reacts to user
    interface events and can be edited directly by
    the user.
  • By picking on a handle and dragging it, the user
    can change the scale and position of the box and
    the object inside of it.
  • Manipulators provide an easy way for
    applications to incorporate direct 3D
    interaction.
  • Example our example 2-3.

21
1. Overview
  • Inventor Component Library
  • Provides window-system support and integration
    with the X-Window System.
  • This library includes
  • A render area (window) object
  • Main loop and initialization convenience routines
  • An event translator
  • Editors
  • Viewers
  • Example 2-4

22
1. Overview
  • Inventor Component Library
  • The render area accepts an X event, translates it
    into an Inventor event, and then passes it to
    "smart" objects, such as manipulators, that may
    handle the event.
  • Components are reusable modules that contain both
    a render area and a user interface.
  • They are used for editing scene graph nodes
    (materials, lights, transformations) as well as
    for viewing scenes in different ways.

23
1. Overview
  • Inventor Component Library
  • Component Example

24
1. Overview
  • Inventor Class Tree(leftBase classes, right the
    derived)

25
1. Overview
  • Inventor Class Tree(leftBase classes, right the
    derived)

26
1. Overview
  • Inventor Class Tree(leftBase classes, right the
    derived)

27
1. Overview
  • Extending the Toolkit
  • One of the most important aspects of Inventor is
    the ability to program new objects and operations
    as extensions to the toolkit.
  • One way to extend the set of objects provided is
    to derive new classes from existing ones (See
    Purple Book).
  • Another way is by using callback functions. A
    callback function is a user-written function that
    is called under certain conditions.
Write a Comment
User Comments (0)
About PowerShow.com