Seminar 1 Scene graph & Hierarchical animation EDA221 Introduction to Computer Graphics Carl Johan Gribel, PhD student

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
BIM313 – Advanced Programming Techniques Debugging 1.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
Computer Graphics Coursework Cookbook original from Anthony Jones modified Dan Cornford (Oct 2010)
Programming The Development Environment and Your First C Program.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Guidelines for working with Microsoft Visual Studio.Net.
1 Modularity In “C”. 2 General Syntax data_type function_Name (parameter list) { … return expression; // return output } Body of the function is a compound.
Guidelines for working with Microsoft Visual Studio 6.
1 3D Modelling with OpenGL Brian Farrimond Robina Hetherington.
Using Visual C++ and Pelles C
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Name of Planet You and Your Partner’s Names Period Provide a caption for each image. Ex: This is a compilation image showing the seasons on Saturn. The.
Debugging Cluster Programs using symbolic debuggers.
C O M P U T E R G R A P H I C S Stuff CMSC 435 / 634 Transformations 1/29 Geometric Transformations Readings: Chapters 5-6.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Introductory Seminar C++ & RenderChimp EDA221 Introduction to Computer Graphics Universitetsadjunkt Mathias Haage Authors: Magnus.
CGDD 4113 MAYA BASICS. THE INTERFACE
1Computer Graphics Input and Interaction Lecture 8 John Shearer Culture Lab – space 2
Creating, Editing, & Debugging a VI A.How to Create VIs B.How to Edit VIs C.How to Debug VIs You Will Learn:
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
How to start Visual Studio 2008 or 2010 (command-line program)
VB – Debugging Tools Appendix D. Why do we need debugging? Every program has errors, and the process of finding these errors is debugging Types of errors.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary.
Seminar 5 Game EDA221 Introduction to Computer Graphics Universitetsadjunkt Mathias Haage Author: Carl Johan Gribel, PhD student.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
E-1 University of Washington Computer Programming I Lecture 5: Input and Output (I/O) © 2000 UW CSE.
Minimal standard C program int main(void) { return 0 ; }
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
CSC 1201 LAB RULES Nouf Aljaffan (C) CSC 1201 Course at KSU.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
CMSC 104, Version 8/061L14AssignmentOps.ppt Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips Reading Section.
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
Debugging Watch and Text Output Alice. Debugging Techniques Several techniques are helpful in eliminating errors (bugs) in programs: careful design incremental.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Design Visualization Software Introduction / Review.
Learners Support Publications Constructors and Destructors.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Constructors and Destructors
A variable is a name for a value stored in memory.
- Introduction - Graphics Pipeline
ATCM 3310 Procedural Animation
EEC-693/793 Applied Computer Vision with Depth Cameras
Testing and Debugging.
Chapter 2 Assignment and Interactive Input
Debugging with gdb gdb is the GNU debugger on our CS machines.
ECE Application Programming
LESSON 20.
CS 153: Concepts of Compiler Design November 30 Class Meeting
Using Visual Studio with C#
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Constructors and Destructors
Our Environment We will exercise on Microsoft Visual C++ v.6
Debugging Visual Basic Programs
Procedural Animation Lecture 2: 3D & Houdini basics
Revolution vs. Rotation
Dr. Chih-Kuo Yeh 葉智國 Computer Graphics Dr. Chih-Kuo Yeh 葉智國
Debugging.
Presentation transcript:

Seminar 1 Scene graph & Hierarchical animation EDA221 Introduction to Computer Graphics Carl Johan Gribel, PhD student

Today Hierarchical animation – T*R*S More on Visual Studio/RenderChimp – Debugging – Atom program Assignment 1 – Solar system

Hierarchical transform torso lower arm upper arm torso lower arm upper arm lower_arm->rotateZ(0, 0, PI/6);upper_arm->rotateZ(0, 0, PI/6);

Compound transform Transformations stored in each node: translation (3d-vector) rotation (3x3-matrix) scaling (3d-vector) Applied in T*R*S order What if further transformations are needed? E.g.: Rotation around arbitrary point p requires a T(p)*R*T(-p) sequence; not achievable by T*R*S only Solution:an extra node, containing another set of transformations

Compound transform: Spin vs orbit world earth sun rotate translate earth pivot rotate earth translate world sun earth spinearth orbit extra node

Decouple spin from orbit world earth pivot sun earth translate rotate earth pivot earth translate world sun rotate sun spin coupled with earth’s orbitsun spin decoupled from earth’s orbit (somewhat more correct astrophysically)

Compound transform: camera world camera camera pivot camera world rotate translate rotate translate ”FP-style””Pivot-style”

Visual Studio Debugging breakpoints DataTips printf precompiler

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 them: Can even expand hierarchically into class members, pointer-targets etc Right-click and select ”Watch” to pin variable to a Watch-window

printf The brute force way: 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

Precompiler Dictates what (not) to compile #define DEBUG_MODE. #if defined DEBUG_MODE // will be compiled only if DEBUG_MODE is defined #endif

Enable debugging To debug, select the ”OpenGL 2.0, Debug” configuration Build + Run (F5)

RenderChimp: SceneGraph class All creation and deletion of Nodes and Resources must go through the SceneGraph class new and delete are not permitted for any RenderChimp objects Light *light = SceneGraph::createLight(“MyLight”); SceneGraph::deleteNode(light); Light *light = new Light(“MyLight”); delete light; Yep! Nope!

RenderChimp: Atom program my_scenegraph.cpp #include "RenderChimp.h” // <-- declare global variables, scene graph nodes... void RCInit() { // <-- initialize variables, nodes...(called ONCE) } int RCUpdate() { // <-- apply transformations... (called EVERY FRAME) } void RCDestroy() { // <-- release allocated memory (called as program exits) }

RenderChimp: Animation Apply animation transformations in the update-routine float earth_spin = 0.6f;// earth spin (rad/s) int RCUpdate() { earth->rotateY( earth_spin * Platform::getFrameTimeStep() ).. } length of a frame (s)

Interaction ”WASD” forward/left/down/right (in camera space) Mouse: Pivot camera left button: absolute angle right button: relative angle

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

Assignment 1 Hint Add planetary rings like this VertexArray *ring_va = createCircleRing(...); Geometry *ring = SceneGraph::createGeometry(“rings”, ring_va); You’ll need #include ”ParametricShapes.h” in the top of your cpp-file

Textures

End