Practical Data Visualization and Virtual Reality. Virtual Reality VR Software and Programming. Karljohan Lundin Palmerius



Similar documents
Virtuelle Realität. Overview. Termin 9: Scene Graphs. Virtuelle Realität. Prof. Bernhard Jung

Chapter 6 - The Scene Graph

Equalizer. Parallel OpenGL Application Framework. Stefan Eilemann, Eyescale Software GmbH

Simulink 3D Animation User's Guide

ANIMATION a system for animation scene and contents creation, retrieval and display

CAD to X3D Conversion with CAD Assembly Structure Hyokwang Lee PartDB Co., Ltd. and Web3D Korea Chapter

Introduction to NaviGenie SDK Client API for Android

CS 378: Computer Game Technology

OctaVis: A Simple and Efficient Multi-View Rendering System

Parallel Visualization of Petascale Simulation Results from GROMACS, NAMD and CP2K on IBM Blue Gene/P using VisIt Visualization Toolkit

Technical Specifications: tog Live

OpenGL & Delphi. Max Kleiner. 1/22

JavaFX Session Agenda

Software Tools for Virtual Reality Application Development

Chapter 6 - The Scene Graph

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Visualization Service Bus

Proposal for a Virtual 3D World Map

Android Basics. Xin Yang

Building Interactive Animations using VRML and Java

Definiens XD Release Notes

Implementação. Interfaces Pessoa Máquina 2010/ Salvador Abreu baseado em material Alan Dix. Thursday, June 2, 2011

XMOS Programming Guide

DM810 Computer Game Programming II: AI. Lecture 11. Decision Making. Marco Chiarandini

Programming 3D Applications with HTML5 and WebGL

Immersive Virtual Reality for Steel Structures

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

SceneBeans: A Component-Based Animation Framework for Java

Overview. Lecture 1: an introduction to CUDA. Hardware view. Hardware view. hardware view software view CUDA programming

LabVIEW Advanced Programming Techniques

Last lecture... Computer Graphics:

ML2VR Providing MATLAB Users an Easy Transition to Virtual Reality and Immersive Interactivity

4D Interactive Model Animations

Data Visualization in Parallel Environment Based on the OpenGL Standard

A Java-based system support for distributed applications on the Internet

Medical and Volume Visualization with X3D

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

Freescale Semiconductor, I

Faculty of Computer Science Computer Graphics Group. Final Diploma Examination

Program Coupling and Parallel Data Transfer Using PAWS

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Debugging with TotalView

The Most Popular UI/Apps Framework For IVI on Linux

Multiresolution 3D Rendering on Mobile Devices

How To Teach Computer Graphics

Monitoring Infrastructure (MIS) Software Architecture Document. Version 1.1

Automating with STEP7 in LAD and FBD

Automating witfi STEP7 in LAD and FBD

Harmonizing policy management with Murphy in GENIVI, AGL and TIZEN IVI

AVS/Express - an object-oriented visual development tool

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Software Tracing of Embedded Linux Systems using LTTng and Tracealyzer. Dr. Johan Kraft, Percepio AB

SPANviewer - A Visualization Tool for Advanced Robotics Applications

RTOS Debugger for ecos

Integration of an open source rule engine to enhance the IHTSDO Workbench testing

Industrial Adoption of Automatically Extracted GUI Models for Testing

Finger Paint: Cross-platform Augmented Reality

How To Run A Factory I/O On A Microsoft Gpu 2.5 (Sdk) On A Computer Or Microsoft Powerbook 2.3 (Powerpoint) On An Android Computer Or Macbook 2 (Powerstation) On

GUI and Web Programming

Computer Graphics Labs

What s New in OMNeT++

An Open Framework for Reverse Engineering Graph Data Visualization. Alexandru C. Telea Eindhoven University of Technology The Netherlands.

A Virtual Laboratory for Computer Graphics Education

Technical Brief. Quadro FX 5600 SDI and Quadro FX 4600 SDI Graphics to SDI Video Output. April 2008 TB _v01

GPI Global Address Space Programming Interface

DIABLO VALLEY COLLEGE CATALOG

Using WPF for Computer Graphics

1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2)

zen Platform technical white paper

3D Client Software - Interactive, online and in real-time

Information Technology Career Field Pathways and Course Structure

Keg Master: a Graph-Aware Visual Editor for 3D Graphs

C Event Display (CED)

Multiprocess System for Virtual Instruments in Python

SQL Anywhere 12 New Features Summary

VisIt Visualization Tool

Visualizing molecular simulations

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Surface and Volumetric Data Rendering and Visualisation

Genius in Salesforce.com Pre- Installation Setup

A Comparison Of Shared Memory Parallel Programming Models. Jace A Mogill David Haglin

REPRESENTATION, CODING AND INTERACTIVE RENDERING OF HIGH- RESOLUTION PANORAMIC IMAGES AND VIDEO USING MPEG-4

A generic framework for game development

Petascale Visualization: Approaches and Initial Results

Extending Desktop Applications to the Web

Transcription:

Practical Data Visualization and Virtual Reality Virtual Reality VR Software and Programming Karljohan Lundin Palmerius

Synopsis Scene graphs Event systems Multi screen output and synchronization VR software systems

Scene Graphs Directed Acyclic Graph (DAG) Hierarchy of nodes (tree) Reflects hierarchy of objects Traversed for processing Essentials Nodes (group or leaf) Edges Nodes Encapsulate behaviour E g group, geometry, properties

Scene Graph Structure Data structure / data exchange formats Standards (VRML, X3D, MPEG-4, etc) Software OpenInventor H3D API OpenSceneGraph (OSG) OpenSG

Scene Graph Program package (Partly) replaces graphics API Should not hinder...only help Framework Extend with new functionality Application Scene Graph OpenGL Hardware Display

Scene Graphs Provide High performance rendering Structured programming Less effort Logical structure Code reuse General purpose, dynamic structure Rapid prototyping Real-time updates Interaction and modification

Software Provides Wide selection Primitives, materials, lights Media import Various manipulations Interactors, camera settings Events, timers, scripting, etc. etc...

VRML/X3D Style Transforms are groups Implicit separation Shape nodes Selected properties Geometry child No leaking property

Node Reuse More than one parent Allowed by DAG Share child node Less memory use Less code Less to update

VRML/X3D Molecule Example Water Molecule 1 Oxygen 2 Hydrogen

X3D Code Tree structure Hierarchy reflected in XML structure XML nodes become scene graph nodes Node children are specified as node contents E g <Group><Group/></Group> Default field name for all nodes Explicitly define container e g containerfield= xyz Values are specified as attributes E g <Material diffusecolor= 0.9 0.4 0.6 />

X3D Code <Root> <Transform translation="432.2-923.6 12.4" rotation="0.257-0.950-0.181 1.175" scale="0.2 0.2 0.2"> <Transform DEF="OXYGEN" translation="0 0 0"> <Shape> <Appearance><Material diffusecolor="0.9 0.9 0.9"/></Appearance> <Sphere radius="0.2"/> </Shape> </Transform> <Transform DEF="HYDROGEN_1" translation="0.3 0.3 0"> <Shape DEF="H_SHAPE"> <Appearance><Material diffusecolor="0.8 0.3 0.3"/></Appearance> <Sphere radius="0.1"/> </Shape> </Transform> <Transform DEF="HYDROGEN_2" translation="0.3-0.3 0"> <Shape USE="H_SHAPE"/> </Transform> </Transform> </Root>

OpenScenegraph C++ Explicit definition Create every node Specify children Set every non-default property Import model from file Put model into scene graph Modifying properties Manual traversal Automatic by visitors

OpenSceneGraph C++ Code int main(){ osgviewer::viewer viewer; osg::positionattitudetransform* moleculexform = new osg::positionattitudetransform; osg::positionattitudetransform* oxygenxform = new osg::positionattitudetransform; osg::positionattitudetransform* hydrogen1xform = new osg::positionattitudetransform; osg::positionattitudetransform* hydrogen2xform = new osg::positionattitudetransform; osg::geode* oxygengeode = new osg::geode; osg::geode* hydrogen1geode = new osg::geode; osg::geode* hydrogen2geode = new osg::geode; osg::sphere O = new osg::sphere(); osg::shapedrawable* shapeo = new osg::shapedrawable(o); osg::sphere H1 = new osg::sphere(); osg::shapedrawable* shapeh1 = new osg::shapedrawable(h1); osg::sphere H2 = new osg::sphere(); osg::shapedrawable* shapeh2 = new osg::shapedrawable(h2);

OpenSceneGraph C++ Code oxygengeode->adddrawable(shapeo); hydrogen1geode->adddrawable(shapeh1); hydrogen2geode->adddrawable(shapeh2); oxygenxform->addchild(oxygengeode); hydrogen1xform->addchild(hydrogen1geode); hydrogen2xform->addchild(hydrogen2geode); moleculexform->addchild(oxygenxform); moleculexform->addchild(hydrogen1xform); moleculexform->addchild(hydrogen2xform); } viewer.setscenedata(moleculexform); return viewer.run();

Networked Objects Event Systems

Event Systems Networked Objects Define data flow Automated run-time processing Software H3D API Visualization Toolkit (VTK) Voreen (Volume Rendering Engine) Qt etc...

H3D API Networked scene graph Events in the scene graph More tasks given to scene graph Program distributed as engines Connecting fields Sending values Event network

Event Systems Nodes Encapsulate a behaviour Fields Define properties of nodes Contain data: colour, translation, light intensity, etc Sensors Event sources: Timers, triggers, mouse, etc Engines Activated by incoming events Process incoming data and computes new data

Event Systems Fields Contains values, e g SField, MField Copy values, calculate new values Contains nodes, e g SFNode, MFNode Routing Copy pointers, create new objects Require good reference counters One field value to many fields Engine may accept many input Lazy evaluation

Simple Example 3D mouse sensor Controls object transform SFVec3f rawtranslation SFVec3f accumulatedtranslation SFRotation rawrotation SFRotation accumulatedrotation SFInt32 buttons Connect field route from 3D mouse translation field route to X-form translation field

Engine Example PythonScript node Field type implemented as class (F2I) Field instance defined as class instance (float2int) F2I float2int

Event Script Example Animation Switch to select frame Floating point TimeSensor Script to convert float to integer

Python Script Code from H3D import * from H3DInterface import * class F2I( TypedField( SFInt32, SFFloat ) ): def update( self, event ): return int(event.getvalue()) float2int = F2I()

X3D Code <?xml version="1.0" encoding="utf-8"?> <Group> <Switch DEF="VSWITCH" whichchoice="0">... </Switch>

X3D Code <TimeSensor DEF="TIME" cycleinterval="5" starttime="0" loop="true" /> <ScalarInterpolator DEF="FRAMES" key="0.2.4.6.8 1" keyvalue="0 1 2 3 4 5" /> <ROUTE fromnode="time" fromfield="fraction_changed" tonode="frames" tofield="set_fraction" /> <PythonScript DEF="PY_FRAME" url="x3d/setup_animation.py" /> <ROUTE fromnode="frames" fromfield="value_changed" tonode="py_frame" tofield="float2int" /> <ROUTE fromnode="py_frame" fromfield="float2int" tonode="vswitch" tofield="whichchoice" /> </Group>

Scene Graph

VR Software Systems

Multi Screen Output Application Scene Graph VR Software OpenGL Hardware Display

Multi-processing Threads Processes Clusters Single computer Single multi-head graphics card Single process with one memory address space Single computer One process per graphics card and display Multiple computers One graphics card per computer Separate memory

Memory and State Access State synchronization and locking Necessary for consistent rendering To avoid tearing Techniques Threads share memory Processes explicit shared memory Serialization over network e.g. TCP/IP Low latency is more important than bandwidth One master, many slaves

Synchronization Needs for synchronization Types avoid inconsistent behaviour across the screens state synchronization what states to render frame synchronization when to switch to the next rendered frame software swap lock over TCP/IP generator lock (gen-lock hardware) when to send the front buffer to the display when to draw left/right image

VR Software Systems Purpose Approach set up cluster nodes and start the VR software handle per display settings, such as viewpoint handle state serialization and synchonization connect to tracking systems, audio, etc. typically a framwork architecture VR System handles the thread provides callbacks for processing and rendering

VR Software Systems VRJuggler Comprehensive Software Init OpenGL SGCT Init OpenGL Advanced Pre Sync Pre Sync Complex SGCT Serialize De-serialize Post Sync Sync Post Sync Pre Draw Simple Clear Buffers Clear Buffers In-house Draw Draw Scene graph Post Draw Post Draw Lock Swap Buffers

SGCT Basics #include <sgct.h> void myinitfun(); void mydrawfun(); void mypresyncfun(); void mycleanupfun(); int main( int argc, char* argv[] ) { sgct::engine gengine( argc, argv ); gengine.setinitoglfunction( myinitfun ); gengine.setdrawfunction( mydrawfun ); gengine.setpresyncfunction( mypresyncfun ); gengine.setcleanupfunction( mycleanupfun ); if(!gengine.init( sgct::engine::opengl_3_3_core_profile ){ return EXIT_FAILURE; } gengine.render(); } exit( EXIT_SUCCESS );

SGCT State Synchronization Encode/decode callback sgct::shareddouble angle(0.0); sgct::shareddouble distance(0.0);... int main( int argc, char* argv[] ) { gengine = new sgct::engine( argc, argv );... sgct::shareddata::instance()->setencodefunction(myencodefun); sgct::shareddata::instance()->setdecodefunction(mydecodefun);... } void myencodefun(){ sgct::shareddata::instance()->writedouble( &angle ); sgct::shareddata::instance()->writedouble( &distance ); } void mydecodefun(){ sgct::shareddata::instance()->readdouble( &angle ); sgct::shareddata::instance()->readdouble( &distance ); }