Theory of Computation & Computer Graphics — Two-Dimensional Transformation, NEC licence examination syllabus (Nepal Engineering Council).
The journey a shape takes from "the world you designed" to "the pixels the user actually sees."
You design objects in "world coordinates" — but the screen only understands pixel positions. The window is the rectangular region of your world coordinates you want to display; the viewport is the rectangular region of the actual screen where that window's contents get drawn.
The two coordinate systems disagree about almost everything, and each disagreement is something the transformation has to reconcile.
UnitsWorld coordinates are whatever suits the problem — metres, kilometres, arbitrary units. Screen coordinates are pixels.
RangeThe world may span any range including negatives. The screen spans a fixed pixel range starting at zero.
ContinuityWorld coordinates are real numbers; pixels are integers, so the final result must be rounded.
DirectionMany screen systems put y = 0 at the TOP with y increasing downward, opposite to mathematical convention.
Keeping world and screen coordinates apart means the drawing code never has to know the screen size. Change the window and you pan or zoom; change the viewport and you resize or move the drawing area — and the objects themselves are never modified.
That is why the same drawing can appear in several panels at once at different sizes, each with its own viewport, all reading the same underlying coordinates.
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Loading…