Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

Similar documents
Scene Graphs. COMP 575/770 Fall 2010

Transformation Hierarchies. CS 4620 Lecture 5

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

2D/3D Geometric Transformations and Scene Graphs

CS 4204 Computer Graphics

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks,

Affine Transformations in 3D

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Transformation Pipeline

CSC 470 Computer Graphics

Lecture 08: Hierarchical Modeling with Scene Graphs

COMP 175 COMPUTER GRAPHICS. Lecture 07: Scene Graph. COMP 175: Computer Graphics March 10, Remco Chang 07 Scene Graph

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1

Computer Graphics. Chapter 7 2D Geometric Transformations

Transforms 1 Christian Miller CS Fall 2011

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

CS559: Computer Graphics. Lecture 12: OpenGL Transformation Li Zhang Spring 2008

Hierarchical Modeling and scene graphs

CS 465 Program 4: Modeller

Hierarchical Modeling

Hierarchical Modeling and Scene Graphs

Using GLU/GLUT Objects

Hierarchical Modeling and Scene Graphs

Hierarchical Modelling

CSCI E-74. Simulation and Gaming

CS 591B Lecture 9: The OpenGL Rendering Pipeline

Hierarchy I. Guoying Zhao 1 / 40

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

OpenGL: Setup 3D World

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Exercise Max. Points Total 90

OpenGL. Toolkits.

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Lecture 5b. Transformation

Graphics Programming

Chapter 3: Modeling Transformation

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Drawing in 3D (viewing, projection, and the rest of the pipeline)

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

Basic Graphics Programming

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Questions HW1 Transform Q/A. Transform. Shaoting Zhang. May 11, 2008

Where We Are: Static Models

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

Precept 2 Aleksey Boyko February 18, 2011

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

Outline. Introduction Surface of Revolution Hierarchical Modeling Blinn-Phong Shader Custom Shader(s)

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations

Computer Graphics. Prof. Feng Liu. Fall /21/2016

OpenGL Tutorial. Ceng 477 Introduction to Computer Graphics

Fachhochschule Regensburg, Germany, February 15, 2017

Luiz Fernando Martha André Pereira

6.837 Computer Graphics Hierarchical Modeling Wojciech Matusik, MIT EECS Some slides from BarbCutler & Jaakko Lehtinen

Transformations. CSCI 420 Computer Graphics Lecture 4

Introduction to Computer Graphics with WebGL

Modeling with Transformations

CS D Transformation. Junqiao Zhao 赵君峤

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

GL_MODELVIEW transformation

Modeling Objects by Polygonal Approximations. Linear and Affine Transformations (Maps)

Sign up for crits! Announcments

Computer Graphics: Viewing in 3-D. Course Website:

Hierarchical Modeling II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

3D computer graphics: geometric modeling of objects in the computer and rendering them

OpenGL Transformations

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Computer Graphics (CS 543) Lecture 6a: Hierarchical 3D Models. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics 7: Viewing in 3-D

Computer Graphics Hands-on

CHAPTER 1 Graphics Systems and Models 3

Hierarchical Modeling

Computer Graphics Geometric Transformations

Hierarchical Models Week 9, Lecture 19

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

Order of Transformations

Introduction to 3D Graphics with OpenGL. Z-Buffer Hidden Surface Removal. Binghamton University. EngiNet. Thomas J. Watson

HIERARCHICAL TRANSFORMATIONS A Practical Introduction

Viewing with Computers (OpenGL)

Lecture 4 of 41. Lab 1a: OpenGL Basics

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

Transformations. Rotation and Scaling

Graphics Pipeline & APIs

Due: Thursday, February 6 th, 11:59 pm TA: Mason Remy

Lecture 2 2D transformations Introduction to OpenGL

Graphics and Visualization

we now have a good understanding of 3d representations, rigid body transforms, camera projections, and the fixed function steps in graphics

Hidden Surface Removal. 3D Graphics with OpenGL. Back-Face Culling

Computer graphics MN1

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

CS 481/681 Advanced Computer Graphics, Spring 2004 Take-Home Midterm Exam

Transcription:

CS4620/5620: Lecture 7 Scene Graphs 1 Announcements HW 1 out PA 1 will be out on Wed Next week practicum will have an office hour type session on Open GL 2

Example Can represent drawing with flat list but editing operations require updating many transforms 3 Groups of objects Treat a set of objects as one Introduce new object type: group contains list of references to member objects This makes the model into a tree interior nodes = groups leaf nodes = objects edges = membership of object in group 4

Example Add group as a new object type lets the data structure reflect the drawing structure enables high-level editing by changing just one node 5 The Scene Graph (tree) A name given to various kinds of graph structures (nodes connected together) used to represent scenes Simplest form: tree just saw this every node has one parent leaf nodes are identified with objects in the scene 6

Concatenation and hierarchy Transforms associated with nodes or edges Each transform applies to all geometry below it want group transform to transform each member members already transformed concatenate Frame transform for object is product of all matrices along path from root each object s transform describes relationship between its local coordinates and its group s coordinates frame-to-canonical transform is the result of repeatedly changing coordinates from group to containing group 7 Instances Simple idea: allow an object to be a member of more than one group at once transform different in each case leads to linked copies single editing operation changes all instances 8

Example Allow multiple references to nodes allows editing of repeated parts in one operation 9 The Scene Graph (with instances) With instances, there is no more tree an object that is instanced multiple times has more than one parent Transform tree becomes DAG directed acyclic graph group is not allowed to contain itself, even indirectly Transforms still accumulate along path from root now paths from root to leaves are identified with scene objects 10

Implementing a hierarchy Object-oriented language is convenient define shapes and groups as derived from single class abstract class Shape { void draw(); class Square extends Shape { void draw() { // draw unit square class Circle extends Shape { void draw() { // draw unit circle 11 Implementing traversal Pass a transform down the hierarchy before drawing, concatenate abstract class Shape { void draw(transform t_c); class Square extends Shape { void draw(transform t_c) { // draw t_c * unit square class Circle extends Shape { void draw(transform t_c) { // draw t_c * unit circle class Group extends Shape { Transform t; ShapeList members; void draw(transform t_c) { for (m in members) { m.draw(t_c * t); 12

Basic Scene Graph operations Editing a transformation Getting transform of object in canonical (world) frame traverse path from root to leaf Grouping and ungrouping can do these operations without moving anything group: insert identity node ungroup: remove node, push transform to children Reparenting move node from one parent to another can do without altering position 13 Adding more than geometry Objects have properties besides shape color, shading parameters approximation parameters (e.g. precision of subdividing curved surfaces into triangles) behavior in response to user input Setting properties for entire groups is useful paint entire window green Many systems include some kind of property nodes in traversal they are read as, e.g., set current color 14

Scene Graph variations Where transforms go in every node on edges in group nodes only in special Transform nodes Tree vs. DAG Nodes for cameras and lights? 15 Transformations in OpenGL! glmatrixmode(gl_modelview); glloadidentity(); {// Draw something: glpushmatrix(); gltranslatef(...); glrotatef(15f,...); {// set color and draw simplices glbegin(gl_triangles); glcolor3f(...); glvertex3f(...); glvertex3f(...); glvertex3f(...); glend(); glpopmatrix(); // toss old transform {// Draw something else: glpushmatrix();... glpopmatrix(); // toss old transform 16

Transformations in OpenGL Stack-based manipulation of model-view transformation, M glmatrixmode(gl_modelview) Specifies model-view matrix glloadidentity() M 4x4 identity gltranslatef(float ux, float uy, float uz) M M T glrotatef(float theta, float ux, float uy, float uz) M M R glscalef(float sx, float sy, float sz) M M S glloadmatrixf(float[] A) M A (Note: column major) glmultmatrixf(float[] A) M M A (Note: column major) Manipulate matrix stack using: glpushmatrix() glpopmatrix() 17 Where are we? Transforms 2D Affine 3D including rotation Principles of Perspective vs. Orthographic Hierarchical Transforms Input: Scene Graphs Now, how to produce a picture Viewing Transforms (including perspective) Hardware pipeline Programmable Shading 18