13.016 Introduction to Geometric Modeling and Computation
OpenGL Mapping to the Viewport
OpenGL lets you specify the coordinates of the geometric primitives in any convenient coordinate system, possibly using floating point numbers. For these primitives to be displayed on the screen, however, the coordinates must be transformed into a specific integer coordinate system. These two coordinate systems are referred to as world coordinates and screen coordinates.
To perform this transformation, we must define the portion of the world coordinate system that will be mapped to the screen coordinate system.
World Coordinate Window
double xmin, xmax, ymin, ymax; gluOrtho2D(xmin, xmax, ymin, ymax);
where xmin, xmax, ymin, and ymax are defined in world coordinates.
Historically, this portion of world coordinate space is called the world coordinate window. Do not confuse this use of the term window with the on-screen windows created and manipulated by the window management system.
Screen Coordinate Viewport
int xo, yo, width, height; glViewport(xo, yo, width, height);
where xo and yo (the lower-left corner of the viewport), and width, and height are defined in screen coordinates.
This coordinate system is referred to as the screen system because it originally was applied to the entire display screen of a terminal. In a modern window system, these coordinates apply to a particular window.
On to window system interaction...
Back to drawing style...
Back to the overview...