Chapter 6 - The Scene Graph



Similar documents
Chapter 6 - The Scene Graph

INTRODUCTION TO RENDERING TECHNIQUES

Introduction to Computer Graphics

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

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

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Game Development in Android Disgruntled Rats LLC. Sean Godinez Brian Morgan Michael Boldischar

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

CPIT-285 Computer Graphics

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

A Short Introduction to Computer Graphics

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

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Maya 2014 Basic Animation & The Graph Editor

Programming 3D Applications with HTML5 and WebGL

How To Teach Computer Graphics

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

SAN DIEGO COMMUNITY COLLEGE DISTRICT MESA COLLEGE ASSOCIATE DEGREE COURSE OUTLINE

HIGH AND LOW RESOLUTION TEXTURED MODELS OF COMPLEX ARCHITECTURAL SURFACES

Teaching Introductory Computer Graphics Via Ray Tracing

AR-media TUTORIALS OCCLUDERS. (May, 2011)

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

User Guide Installing the 3D Studio plug-ins

Adding Animation With Cinema 4D XL

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

Geant4 Visualization. Andrea Dotti April 19th, 2015 Geant4 M&C+SNA+MC 2015

Tutorial: Biped Character in 3D Studio Max 7, Easy Animation

Surface and Volumetric Data Rendering and Visualization

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

Computer Animation: Art, Science and Criticism

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

The Rocket Steam Locomotive - Animation

Basic Understandings

Using WPF for Computer Graphics

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. M.Sc. in Advanced Computer Science. Friday 18 th January 2008.

CS 325 Computer Graphics

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

COMP-557: Fundamentals of Computer Graphics McGill University, Fall 2010

Creating Your Own 3D Models

3D Modeling, Animation, and Special Effects ITP 215x (2 Units)

Blender 3D Animation

Lab7 : Putting Everything Together

Character Animation Tutorial

Course: 3D Design Title: Deciduous Trees Blender: Version 2.6X Level: Beginning Author; Neal Hirsig (June 2012) Deciduous Trees

Realtime 3D Computer Graphics Virtual Reality

Java game programming. Game engines. Fayolle Pierre-Alain

VRayPattern also allows to curve geometry on any surface

Introduction to 2D and 3D Computer Graphics Mastering 2D & 3D Computer Graphics Pipelines

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

4VATARS PROJECT. Standard avatar specification for content creation in RealXtend

Compositing a 3D character over video footage in Maya Jean-Marc Gauthier, Spring 2008

Thea Omni Light. Thea Spot Light. Light setup & Optimization

Maya 2014 Still Life Part 1 Texturing & Lighting

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

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

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

How To Learn To Program In Csc 406 Computer Graphics

SceneBeans: A Component-Based Animation Framework for Java

JavaFX 3D Animation: Bringing Duke to Life

Institution : Majmaah University. Academic Department : College of Science at AzZulfi. Programme : Computer Science and Information Course :

Multiresolution 3D Rendering on Mobile Devices

CS 4620 Practicum Programming Assignment 6 Animation

Spotfire v6 New Features. TIBCO Spotfire Delta Training Jumpstart

Hierarchy and Tree Visualization

Intro to 3D Animation Using Blender

Using HDR Panoramas. Dr Ryan Southall - School of Architecture & Design, University of Brighton.

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

Computer Graphics. Computer graphics deals with all aspects of creating images with a computer

Sweet Home 3D user's guide

1. Definition of the project. 2. Initial version (simplified texture) 3. Second version (full textures) 5. Modelling and inserting 3D objects

Blender addons ESRI Shapefile import/export and georeferenced raster import

TREE BASIC TERMINOLOGIES

3D-GIS in the Cloud USER MANUAL. August, 2014

JavaFX Session Agenda

International Journal of Software and Web Sciences (IJSWS)

Cork Education and Training Board. Programme Module for. 3 Dimensional Computer Graphics. Leading to. Level 5 FETAC

Template-based Eye and Mouth Detection for 3D Video Conferencing

14.6 Construction and Animation via Hierarchical Modeling

Getting Started with iray in 3ds Max 2014

ACE: After Effects CS6

BCC Multi Stripe Wipe

CURRICULUM VITAE EDUCATION:

Binary Search Trees (BST)

3D VIRTUAL DESKTOP APPLICATION Of UNSW. Introduction. What we propose to do 2/4. What we propose to do 1/4. What we propose to do 4/4

Water Flow in. Alex Vlachos, Valve July 28, 2010

SketchUp Instructions

Visualization methods for patent data

SimLab 3D PDF. Settings

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

3D Analysis and Surface Modeling

Transcription:

Chapter 6 - The Scene Graph Why a scene graph? What is stored in the scene graph? objects appearance camera lights Rendering with a scene graph Practical example 1

The 3D Rendering Pipeline (our version for this class) 3D models in model coordinates 3D models in world coordinates 2D Polygons in camera coordinates Pixels in image coordinates Scene graph Camera Rasterization Animation, Interaction Lights 2

Why a Scene Graph? Naive approach: for each object in the scene, set its transformation by a single matrix (i.e., a tree 1 level deep and N nodes wide) advantage: very fast for rendering disadvantage: if several objects move, all of their transforms change Observation: Things in the world are made from parts Approach: define an object hierarchy along the part-of relation transform all parts only relative to the whole group transform group as a whole with another transform parts can be groups again http://www.bosy-online.de/veritherm/explosionszeichnung.jpg 3

Chapter 6 - The Scene Graph Why a scene graph? What is stored in the scene graph? objects appearance camera lights Rendering with a scene graph Practical example 4

Geometry in the Scene Graph Leafs are basic 3D objects Non-leaf nodes (groups) contain a transformation Welt can have one or several children transformation is given by a homogeneous Matrix Root is the entire world Auto TAuto TKarosserie Karosserie Räder TRäder Nodes can be the child of several groups TChassis Chassis Kabine grau Rad1 Rad2 Rad3 Rad4 not a tree, but a directed acyclic graph (DAG) Quader1 Quader2 TKabine Rad effective reuse of geometry Felge Reifen Zylinder1 weiß Zylinder2 schwarz 5

Appearance in the Scene Graph Scene graph also contains appearances Appearance: E.g. Color, reflection, transparency, texture Details see next lecture can be reused similarly to geometry Auto Appearance can be only partially specified unspecified values are inherited Karosserie Räder Chassis Kabine grau Rad1 Rad2 Rad3 Rad4 Quader1 Quader2 Rad Felge Reifen Zylinder1 weiß Zylinder2 schwarz 6

Lights in the Scene Graph Light sources also need a position and/or direction Welt Just include them into the scene graph Can be animated just like geometry Auto Sonne Lights can be in local coordinate systems of geometry groups Karosserie Räder Licht1 move with them Chassis Kabine grau Rad1 Rad2 Rad3 Rad4 example: lights on a car Quader1 Quader2 Rad Felge Reifen Zylinder1 weiß Zylinder2 schwarz 7

The Camera in the Scene Graph Camera also needs a position and direction Just include it into the scene graph Welt Can be animated just like geometry Kamera Sonne Auto Camera can be in local coordinate systems of geometry groups Kamera1 Karosserie Räder Licht1 move with them example: driver s view from a car Chassis Kabine grau Rad1 Rad2 Rad3 Rad4 Quader1 Quader2 Rad Felge Reifen Zylinder1 weiß Zylinder2 schwarz 8

Chapter 6 - The Scene Graph Why a scene graph? What is stored in the scene graph? objects appearance camera lights Rendering with a scene graph Practical example 9

Scene graph traversal for rendering set Tact to TAuto push state Auto set Tact to Tact x TKarosserie push state Karosserie Räder set Tact to Tact x TChassis render Quader1 Chassis Kabine grau Rad1 Rad2 Rad3 Rad4 pop state set Tact to Tact x TKabine render Quader2 Quader1 Quader2 Rad pop state pop state Felge Reifen set Tact to Tact x TRäder... Zylinder1 weiß Zylinder2 schwarz 10

Scene Graph Libraries Scene graphs exist on a more abstract layer than OpenGL! VRML/X3D descriptive text format, ISO standard OpenInventor based on C++ and OpenGL originally Silicon Graphics, 1988 now supported by VSG3d.com Java3D provides 3D data structures in Java not supported anymore Open Scene Graph (OSG) Various Game Engines e.g. JMonkey 3 (scene graph based game engine for Java) http://www.shlomifish.org/open-source/bits-and-bobs/open-inventor-bsd-daemon/ 11

Chapter 6 - The Scene Graph Why a scene graph? What is stored in the scene graph? objects appearance camera lights Rendering with a scene graph Practical example 12

Example: Hierarchically Structured Object Simple object composed from basic geometric forms Here: Cylinders, hemispheres Resembling e.g. a resistor in electronics Main form element: Cylinder Additional form elements: Two ends Each end consisting of: a hemisphere a connector 13

Exercise: Scene Graph for Example What is the scene graph for the example? Which are the transformations in each node? Which additional information should be stored in each node? 14

Example Implementation Using JMonkey Engine 3 (JME3) Open Source community project Based on Java and OpenGL Using scene graphs as core concept (as most gaming engines) See http://jmonkeyengine.org/ Terminology of the JMonkey scene graph: Spatial : Common abstraction for all nodes in a scene graph Node : Abstract (inner) nodes in a scene graph not rendered Geometry : Leaf node in a scene graph visibly rendered Information attachable to scene graph nodes ( spatials ): Local affine transformation (translation, scaling, rotation) Material (e.g. self-illuminating colored materials, but many else) see next lecture 15

Local Coordinates and World Coordinates Each primitive object is created in a local coordinate system Around the origin or at a specified location Object is moved/scaled/rotated to required position relative to father node next level up Object is inserted into scene graph actually determines father node World coordinate position of object is determined by composition of all transformations along path from root to object as used in rendering algorithm Objects: simple geometrical objects in this section general polygon meshes (see last chapter) in practice 16

Example (JMonkey Engine) Part 1 Creating the core part of the scene Cylinder constructor in JME: (samples in axis, samples in radius, radius, height) What does this mean? Mesh : pure geometrical data, to be wrapped into scene graph objects Why is it likely that we need a rotation for seeing the object like we want it? Around which axis? What is the unit for the angle? /** create a green cylinder at origin */ Cylinder cylmesh = new Cylinder(64,64,1.5f,3); Geometry cylinder = new Geometry("Cylinder", cylmesh); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.setcolor("color", ColorRGBA.Green); cylinder.setmaterial(mat1); cylinder.rotate(90*fastmath.deg_to_rad,0f,0f); 17

Example (JMonkey Engine) Part 2 /** create a red dome */ Dome domemesh = new Dome(Vector3f.ZERO,64,64,1.5f,false); Geometry dome1 = new Geometry("UpperDome", domemesh); Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat2.setcolor("color", ColorRGBA.Red); dome1.setmaterial(mat2); This creates a new object: Where is it located by default? What do we have to do with it to make good use of it? 18

Example (JMonkey Engine) Part 3 //++ create a little blue cylinder */ Cylinder litcylmesh = new Cylinder(32,32,0.1f,1); Geometry litcylinder = new Geometry("Cylinder", litcylmesh); Material mat3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat3.setcolor("color", ColorRGBA.Blue); litcylinder.setmaterial(mat3); litcylinder.rotate(90*fastmath.deg_to_rad,0f,0f); litcylinder.move(0f,1.5f,0f); /** upper end: combine red dome and little blue cylinder by node */ Node upperend = new Node("upperEnd"); upperend.attachchild(dome1); upperend.attachchild(litcylinder); What is the overall result ( Upper End ) of this? Why is it important to move the little cylinder before combining it with the red dome? 19

Example (JMonkey Engine) Part 3 /** lower end: create a clone of upper end */ Node lowerend = (Node) upperend.clone(); /** put the upper end above the cylinder */ upperend.move(0f,1.7f,0f); /** put the lower end below the cylinder */ lowerend.move(0f,-1.7f,0f); lowerend.rotate(180*fastmath.deg_to_rad,0f,0f); Why is this program code so short? Why is it good to use a clone function here? 20

Example (JMonkey Engine) Part 4 Overall presentation Compose main objects of the scene Attach scene objects to world root ( rootnode in JME) Carry out global transformations for whole world Projection modes (e.g. orthographic vs. perspective) may be specified at this level Camera position (and other camera parameters) may be specified separately for projection or may be part of scene graph /** Create a pivot node at (0,0,0) and attach it to the root node */ Node pivot = new Node("pivot"); rootnode.attachchild(pivot); // put this node in the scene pivot.attachchild(cylinder); pivot.attachchild(upperend); pivot.attachchild(lowerend); /** Rotate the pivot node: Note that all objects have rotated! */ pivot.rotate(0.4f,0.4f,0f); 21

Scene Graphs in Practice Creation of scene graphs and objects Specific authoring software (e.g. Blender, Maya, 3DS Max) Assets (models, objects) exported to exchange formats E.g. (X3D,) Wavefront OBJ (.obj), 3ds Max (.3ds), Ogre XML (.mesh) Objects typically are tesselated Polygon meshes No primitive geometric objects visible/readable anymore Example: JME Scene 22

Outlook: Lighting and Scene Graphs Types of light: Ambient light: No specific direction, like diffuse day light Directional light: No specific source location, but specific direction Like sunlight Various artificial light sources (spot lights, point lights): Occupy specific position in scene graph Effect of light depending on material See next lecture 23