EIG Chapter1
EIG Chapter1
Shirley, S. Baer
Goals
Give student some idea what this
class is about
Start Event Driven Programming
if possible
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"
Intro and Chapter 1
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P.
Shirley, S. Baer
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!
Intro and Chapter 1
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P.
Shirley, S. Baer
Results: Expectations
Past good students get job at games
company:
Difficult to get graphics (or game) specific
jobs
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!
Intro and Chapter 1
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P.
Shirley, S. Baer
Our approach:
Learn concepts (transformation)
See how implemented
You:
Use the implementation in more
complex applications
Implement some of the concepts not
shown in tutorials
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:
We will build this over the quarter
Let begin!
Ball shooting program (Tutorial
5.6)
Ask ourselves, what are needed to
implement this program?
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)
Intro and Chapter 1
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P.
Shirley, S. Baer
Interesting differences
MainEventLoop() is not ours!
We as programmer, we cannot change this function!!
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
Pseudo Code …
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
Intro and Chapter 1
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P.
Shirley, S. Baer
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!