Lecture 2 Overview
- The difference between graphics and other applications
- What is a bad user interface? EASY Question
- What is a good user interface? HARD Question
The difference between graphics and other applications
- Hardware for graphics is driven by the application.
- The application must respect the hardware and its capability.
- Input comes from a person rather than a device
Implications of this
- We always need to be aware of hardware implications
- We need to understand graphical input devices
- The design of the user interface becomes crucial
Standard OpenGL Program you'll be writing
int main(int argc, char** argv)
{
/*
* this talks to the particular display and opens the relevant window,
* sets drawing modes and gets the process started.
*/
DisplaySetup(argv[0]);
/*
* this is a user written program to initialize data structures,
* define context, ...
*/
my_init();
/*
* This sets up the necessary user interaction
*/
MouseSetup();
/*
* This is the main loop, the function display()
* is called at every refresh cycle.
*/
auxMainLoop(display);
}
void DisplaySetup(char *av) {
/* how to display */
auxInitDisplayMode (AUX_SINGLE | AUX_RGB);
/* where to display */
auxInitPosition (0, 0, 100, 100);
/* actually create the window */
auxInitWindow (av);
/* what to do if the user reshapes */
auxReshapeFunc (myReshape);
}
void InteractSetup(void) {
/* if the left button is down and the mouse moves, calls pickLine */
auxMouseFunc (AUX_LEFTBUTTON, AUX_MOUSELOC, pickLine);
/* if the middle button is down and the mouse moves, calls rotateLine */
auxMouseFunc (AUX_MIDDLEBUTTON, AUX_MOUSELOC, rotateLine);
/* if the up arrow key is hit, calls hello */
auxKeyFunc (AUX_UP, hello);
}
void hello(AUX_EVENTREC *event) {
printf("hello there \n");
}
How the hardware works
Pieces of the hardware
- The system bus
- The monitor and video controller
- The CPU, system memory, disk, ...
- I/O devices (mouse, keyboard, ... )
- The frame buffer memory
Display on a raster graphics system
-
The frame buffer memory interacts with the system memory off the bus.
-
At every refresh, the video controller paints the contents of
the frame buffer memory onto the screen.
-
The painting is done by converting bits (in the case of monochrome)
or bytes (in the case of full color) of frame buffer memory into dots
(for monochrome) or intensities (for color) on the screen.
-
The intensities ultimately translates into numbers of electrons
to be shot at the screen by an electron gun.
-
The gun is aimed by a shadow mask to hit and excite the phosphor
which creates the image.
-
For color, there are three separate guns (Red, Green and Blue).
For this to work, everything that is drawn must be scan converted.
That is, converted from a continuous figure into a series of dots
(and possibly intensities) to be shown. The dots or intensities
are written into the frame buffer and the process proceeds.
User Interaction
- User interaction devices
- Making User interaction meaningful
User Interaction devices
Logical classes
- Locator -- a device for specifying coordinate position
- Stroke -- a device for specifying a series of coordinate position
- String -- a device for specifying text input
- Valuator -- a device for specifying scalar values
- Choice -- a device for selecting menu options
- Pick -- a device for selecting picture components
Physical classes
- Mouse
- most common 2D locator
- works optically (electronic) or digitally (mechanical)
- typically have 1,2, or 3 buttons
.
- Drawing with a mouse is like drawing with a bar of soap
-
Buttons and Keyboards
- easily mapped to commands
- allow chording
-
Tablet
- designed for writing and drawing
- range from high precision drawing tablets
(stylus can detect pressure and position) to pen based
(e.g. the Newton).
- work on relative, not absolute, position
- work by sending RF pulses from stylus to tablet, using tablet
as an antenna to detect pulses
-
Data glove
- 3D versions of tablets
- can be used to grasp an object
-
Touch panel
- direct versions of tablets, the pointer is your finger
- imprecise resolution
- input recorded using optical, electrical or acoustical methods
-
Voice systems
- trained to a user
- match words from a dictionary
Making User Interaction meaningful
Guiding principles
- Use Windows and Icons wisely
- Accomodate multiple skill levels
- Be consistent
- Provide User Feedback
- Have undo facilities or run a log of the session