EDAF80 Introduction to Computer Graphics. Seminar 1. Hierarchical Transformation. Michael Doggett. Some slides by Carl Johan Gribel,

Similar documents
Introductory Seminar

EDAF80 Introduction to Computer Graphics. Seminar 3. Shaders. Michael Doggett. Slides by Carl Johan Gribel,

Seminar 2. Tessellation & Interpolation. Pierre Moreau. EDAF80 Introduction to Computer Graphics

CSE 167: Introduction to Computer Graphics Lecture 11: Scene Graph 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Mobile graphics API Overview

CSE 167: Introduction to Computer Graphics Lecture #8: Scene Graph. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

HIERARCHICAL TRANSFORMATIONS A Practical Introduction

CSE 167: Introduction to Computer Graphics Lecture #9: Scene Graph. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

HIERARCHICAL TRANSFORMATIONS A Practical Introduction

Shading and Texturing Due: Friday, Feb 17 at 6:00pm

Shaders. Slide credit to Prof. Zwicker

Lecture 12: Mid-term test solution & project. CITS 3003 Graphics & Animation

CS 4620 Program 3: Pipeline

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

HIERARCHICAL TRANSFORMATIONS A Practical Introduction

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

Lab 8 - Vectors, and Debugging. Directions

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

OUTLINE. Hierarchical Models Z-Fighting Primitives Besides Triangles Back Face Culling

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders

OPENGL RENDERING PIPELINE

NVIDIA FX Composer. Developer Presentation June 2004

Setting up a Project and Debugging with Visual Studio

OpenGL Essentials Training

Lecture 08: Hierarchical Modeling with Scene Graphs

COMP371 COMPUTER GRAPHICS

Transforms 1 Christian Miller CS Fall 2011

Due: Thursday, April 28 th by the stroke of midnight! TA: Jeff Booth

Introduction to Computation and Problem Solving

This allows you to choose convex or mesh colliders for you assets. Convex Collider true = Convex Collider. Convex Collider False = Mesh Collider.

CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS SPRING 2016 DR. MICHAEL J. REALE

IMAGE-BASED RENDERING AND ANIMATION

CHAPTER 1 Graphics Systems and Models 3

Computer graphics 2: Graduate seminar in computational aesthetics

CIS 581 Interactive Computer Graphics

Game Architecture and best practices

A simple OpenGL animation Due: Wednesday, January 27 at 4pm

3D Modeling. 3D Modeling 1

Final Project. Houdini

CS248 Lecture 2 I NTRODUCTION TO U NITY. January 11 th, 2017

1 20 pts Graphics Pipeline short answer

Project 2: 3D transforms and Cameras

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation

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

COMP371 COMPUTER GRAPHICS

EDAN30 Photorealistic Computer Graphics

Introduction to 2D Graphics

Lecture 18 of 41. Scene Graphs: Rendering Lab 3b: Shader

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Creating the Tilt Game with Blender 2.49b

Homework 3: Programmable Shaders

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

CS451Real-time Rendering Pipeline

Beaumont Middle School Design Project April May 2014 Carl Lee and Craig Schroeder

CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen s slides) Requirements. Reference Books. Textbook

Problem Max. Points Total 80

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

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Game Graphics & Real-time Rendering

TIEA311 Tietokonegrafiikan perusteet kevät 2018

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

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

Game Design Unity Workshop

COS 116 The Computational Universe Laboratory 10: Computer Graphics

the gamedesigninitiative at cornell university Lecture 12 2D Animation

OpenGL: Setup 3D World

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Assignment 1 due 4/13/2017 at 11:59PM Topic: Getting Started with WebGL and Transformations

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

Graphical Editors used at CSC/Nada earlier. Main competitors. What is Maya? What is Maya? An Introduction to Maya. Maya

printf Debugging Examples

Computer Graphics - Treasure Hunter

Keyframe Animation. Animation. Computer Animation. Computer Animation. Animation vs Modeling. Animation vs Modeling

CS Simple Raytracer for students new to Rendering

CS535: Interactive Computer Graphics

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

3D GRAPHICS. design. animate. render

Introduction to the Graphics Module Framework

Where We Are: Static Models

Computer Graphics Coursework 1

Modeling. Anuj Agrawal Dan Bibyk Joe Pompeani Hans Winterhalter

Lighting and Texturing

THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) COMP4610/COMP6461 (Computer Graphics) Final Exam

3D Rendering Pipeline

Creating a nice GUI. OpenGL and Windows. Note: VS 2003 shown. Create a new Project

TEACHING PLAN FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI UNIVERSITI TEKNIKAL MALAYSIA MELAKA

This lecture. Introduction to VRT. Hardware. Implementation levels. Scene-Graph libraries. Computer Graphic libraries

CGT520 Transformations

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

Starting Visual Studio 2005

CS 380 Introduction to Computer Graphics. LAB (1) : OpenGL Tutorial Reference : Foundations of 3D Computer Graphics, Steven J.

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

OPENGL AND GLSL. Computer Graphics

Full Screen Layout. Main Menu Property-specific Options. Object Tools ( t ) Outliner. Object Properties ( n ) Properties Buttons

8K Earth, Moon and Mars Shaders Asset V Documentation

Lecture 13: OpenGL Shading Language (GLSL)

WebGL A quick introduction. J. Madeira V. 0.2 September 2017

Transcription:

EDAF80 Introduction to Computer Graphics Seminar 1 Hierarchical Transformation Michael Doggett 2017 Some slides by Carl Johan Gribel, 2010-13

Today Hierarchical Transformation and Scene Graphs TRS - Translation, Rotation, Scaling C++/OpenGL Framework Bonobo, and other libraries Visual Studio Debugging Assignment 1 - Solar System MD16 2

From lecture: transformation matrices

Hierarchical transform: rigid body

Hierarchical transform: rigid body torso upper arm lower arm TRS TRS TRS geometry & scene graph TRS* TRS*TRS* TRS*TRS*TRS* transformations applied during rendering

Hierarchical transform: rigid body torso torso upper arm upper arm R z lower arm R z lower arm

Hierarchical transformation world sun world sun R y sun spin

Hierarchical transformation: Spin vs Orbit world sun earth T x R y planet spin

Hierarchical transformation: Spin vs Orbit world world sun sun extra node earth T x R y earth pivot R y earth T x planet spin orbit

Hierarchical transformation: Spin vs Orbit world sun R y world earth pivot R ys sun earth pivot R ye earth T x earth T x sun spin, planet orbit (coupled) orbit sun spin, planet orbit (decoupled)

Scene Graphs Y X Z MD16 11

C++/OpenGL Framework - Libraries User Interface (GLFW, imgui) Window, GL context, mouse, key, log window, GUI Using OpenGL 4.1 Resource loading Model/Geometry loading (assimp) Image/Texture loading (lodepng) Vector algebra library (GLM) Based on OpenGL Shading Language (GLSL) Specification Don t need to look at this code, just use them as tools MD16 12

C++/OpenGL Framework - Functions Sphere structure (sphere_t) Node class child pointers to build a simple scene graph render() member function to Draw the sphere OpenGL texture setup function (loadtexture2d() ) Shader setup - loading, compiling, linking (createprogram() ) Assignment1 class for this project Init(), destructor, run() functions while loop to render scene graph Add per frame node operations here (for example : sun.rotate_y(0.01f);) Pushes root_node onto a stack, then process all nodes MD16 13

Making a node sphere and shader are setup and can be reused auto sun = Node(); auto sun_texture = loadtexture2d("sunmap.png"); sun.set_geometry(sphere); sun.set_program(shader, [](GLuint /*program*/){} ); sun.add_texture("diffuse_texture", sun_texture, GL_TEXTURE_2D); MD16 14

Adding nodes Add new nodes to the sun, etc. auto world = Node(); world.add_child(&sun); sun.add_child(/* Add your node here */); MD16 15

Moving nodes Use translation, rotation and scaling functions Use nowtime for current time How is this different to constant values? sun.set_translation(glm::vec3(std::sin(nowtime), 0.0f, 0.0f)); earth.translate( vec3 ); earth.scale(0.2); MD17 sun.set_rotation_y(0.7); 16

Interaction First Person-style FPS camera : WASD move camera forward/left/back/right Mouse Left button : control camera Right button : control gui (log window). double click to minimize MD16 17

Visual Studio Debugging breakpoints DataTips printf

Breakpoints Toggle breakpoint on current line with F9 Pauses execution: enters break mode Right-click on the breakpoint symbol to add conditions, hit-counters, filters...

DataTips Available during break mode Display / edit variables by hovering over them: Can even expand hierarchically into class members, pointer-targets etc Right-click and select Watch to pin variable to a Watch-window

printf Brute force debugging: print whatever you need to monitor to the standard output (console window) printf( I want to monitor this value: %f\n, var); Can format the output Can monitor output continuously as the program executes Messy code

Assignment 1 Model the solar system! Sun, planets, moons, comets...spaceships? It s up to you. Resources included in Framework are at your disposal Models, textures, shaders Code for how to add shaders is included (more in assignment 3-4) See assignment description (PDF) for details Available on webpage

Assignment 1 Get the code from Github Checkout the README.rst file in the download for more instructions you can read it on Github https://github.com/luggpublic/cg_labs Look for comments for where to add your new code in : assignment1.cpp, edaf80::assigment1::run() Add planets, animate planets Fix current node s hierarchical transform node.cpp, Node::get_transform() const (at end of file) Fix transform computation Student Lab Computers Windows will only allow EXEs to run in a directory with a directory called Program in the hierarchy MD16 23

Assignment 1 MD16 24

Textures http://planetpixelemporium.com/planets.html You will need to convert jpegs to png

Next Download the code and get started Post questions to the forum Watch the forum for updates MD16 26