Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
Tailoring Needs Chapter 3. Contents This presentation covers the following: – Design considerations for tailored data-entry screens – Design considerations.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Chapter 10: Coordinate Systems Chapter 10.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 7 Chapter 7: Graphical Primitives.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 3 Chapter 3: Simple Graphics Program.
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 2 Chapter 2: GUI API.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
Graphical User Interfaces in Haskell Koen Lindström Claessen.
Lecture 7: Objects and Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
V Avon High School Tech Club Agenda Old Business –Delete Files New Business –Week 16 Topics: Intro to HTML/CSS –Questions? Tech Club Forums.
Week 4-5 Java Programming. Loops What is a loop? Loop is code that repeats itself a certain number of times There are two types of loops: For loop Used.
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
CS378 - Mobile Computing App Project Overview. App Project Teams of 2 or 3 students Develop an Android application of your choosing subject to instructor.
Welcome to CIS 083 ! Events CIS 068.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Introduction to Matlab & Data Analysis
Intro to GUIs (Graphical User Interfaces) Section 2.5Intro. to GUIs: a GUI Greeter Section 3.7Graphical/Internet Java: Einstein's Equation.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
C H A P T E R T E N Event-Driven Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Verb Expansion Game Team 3 Bryan Bloss Jeremy Comardelle Gordon Gable Gleyner Garden Sponsored By: Dr. Beth Young.
Introduction to Windows Programming
School of Computer Science & Information Technology G6DICP - Lecture 17 GUI (Graphical User Interface) Programming.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 5 Chapter 5: MVC Architecture.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Dale Roberts Introduction to Visual Programming Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
MiniDraw Introducing a Framework... and a few patterns.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
PYGAME.
Chapter Topics 15.1 Graphical User Interfaces
Event-driven programming
Event loops 16-Jun-18.
Goals Give student some idea what this class is about
Chapter 2: GUI API Chapter 2.
Event Driven Programming
Chapter 5: MVC Architecture Chapter 5.
Learn… Create… Program
Event loops.
Learn… Create… Program
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Chapter 15: GUI Applications & Event-Driven Programming
Event loops 8-Apr-19.
Learn… Create… Program
Learn… Create… Program
Event loops.
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea what this class is about Start Event Driven Programming if possible

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 What is this class about Building interactive graphics applications Ask: "What is interactive"? real time "What is graphics"? visualization of geometry human as IO device

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 What is non-interactive application? Show ray tracer and output BumpScene/color.jpg - the color file BumpScene/CommandFile.Bump - to bump the file BumpScene/BumpImage.Color.jpg - color rendered image BumpScene/BumpImage.BumpOut.jpg - bumped file sacrifice time for quality (always true) animated movies are not done with "real time interactive"

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Results: Demo Demo a couple of previous year's project FORMS! need to sign form to have projects posted. major difference with simple games: we do LOTS of unnecessary work!!. e.g., transformation multiple views real collision proper software architectural structure Our projects also lack in fun!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Results: Expectations Past good students get job at games company: Peter Yiap: Big fish Robert Stone: Amaze entertainment This is A LOT of work! Make sure you understand each assignment! the assignments build on each other) Large source code it helps if you like programming!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Our approach: Learn concepts (transformation) See how implemented (Tutorial 9.x) You: Use the implementation in more complex applications Implement some of the concepts not shown in tutorials

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Language and API Language: C++ You can use C# (XNA) Java (require more work): trick is lanauge, GUI and Graphics API are tightly related. GUI API: MFC WinForm (for C#), WTL (C++), GLUT/FLTK (OpenGL) Swing (Java) Graphics API: Direct3D and OpenGL You can use Java3D (only with Java) XNA Framework (only with C#)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Tutorials: Start simple (few files) builds up over the quarter (100+ files) Most of the code will be provided to you In the forms of software library: Libraries: versions 1 to 12 Organizations: Chapter_xx/Tutorial_xx.y_OnPageZZZ/C++_D3D_MFC In C++ and D3D and MFC Chapter_xx/Tutorial_xx.y_OnPageZZZ/C++_OGL_MFC In C++ and OGL and MFC In the future: C# and WinForm and XNA Framework

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Provided source code: You NEED to understand the implementation of the source code provided to you! If your program does not work because of the library: it is your fault! Source is provide for you, you should fix the problem!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Library: naming UWBGL_D3D_Lib1 to UWBGL_D3D_Lib12 File names: All names begin with uwbgl_D3D E.g.: uwbgl_D3DCircleGeom.h, we often refer to the file simply as “CircleGeom.h” All names end with a version number E.g.: uwbgl_D3DCircleGeom2.h: second version of the file File version number is independent from library veriosn number. E.g., since the file uwbgl_D3DGraphicsSystem1.h did not change, is belongs to UWBGL_D3D_LIB2 Replace D3D by OGL/XNA/MFC for different API types

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Learning from source code: User of source code Learn how to build applications by calling the provided functions Evaluator of the source code Use the provided source code, and Evaluate: what is good, why is it bad Developer of your own system Use the provided source as an example prototype Develop your own supporting library MOST REWARDING! Time demanding!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Let begin! Ball shooting program (Tutorial 6.6) Ask ourselves, what are needed to implement this program?

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Control driven programs

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 More detailed parsing …

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Concerns Complexity of our code Number of events! Un-handled events! (expose, iconize, …) Efficiency constantly waiting for the user Repeating of similar work across applications (e.g., iconize)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event driven programming No notion of main() function! Instead: have a MainEventLoop() function …

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Main Event Loop

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Interesting differences MainEventLoop() is not ours! We as programmer, we cannot change this function!! Instead, we have to program _with_ this function! What happens at Label A? and How to define “service routine”? Interesting points: Label B: loop forever!! When will your program ever quit? Label C: wait (instead of busy loop) Label D: every event has a default action

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event Driven Program

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Pseudo Code …

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event Program structure Application State Well defined Persist over function calls Service of Events To change the application state Optional: kind of nice to have displaying of application state

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event: Origin and Handling Operating System and Window Manager Windows (Integrated system) Unix + X Windows with twm, mwm, etc. GUI API Graphical User Interface Application Programming Interface Define GUI Element for handling events

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 GUI Elements: Virtual/Abstract IO devices Windows, Buttons, Slider bars, etc. Associated with each GUI element, there are a set of defined events: E.g., Button: click, release, double click, etc. E.g., Window: mouse over, mouse move, etc. As programmer, we can: Ignore events from a GUI element or Service events from a GUI element

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Events:Categories User: generated events Application specific: LMB click/drag We should service this General: iconize Window manager will service this Application generated events Timer: we should service this External: GUI state change: E.g., SystemInitialization() Select interested ones to service Window Environment: E.g., Exposure Select interested ones to service Request Collaboration: E.g., Redraw events Must service!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event Service registration Subclass override methods (A) Call back function registration (D1)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event Service Routines Service one state and return Stateless!! Should not contain presistent variables Verify invocation conditions Error checking Our tutorials has serious problem with lack of error checking!!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event Service: Ball Shoot Application state + Registration

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Event service: Ball shoot