









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of window-to-viewport mapping in computer graphics, which is used to transform points from world coordinates to screen coordinates. The basics of screen and world coordinate systems, the need for window-to-viewport mapping, and the steps to calculate the corresponding screen coordinates for a given world coordinate. It also includes an example using opengl and a more detailed explanation of the calculation process.
Typology: Slides
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Computer Graphics
2D Graphic Systems
n Screen coordinate system
n World coordinate system
n World window
n Viewport
n Window to Viewport mapping
etc.
•Rectangular region in the screen used to display drawing
•Defined in screen coordinate system
V.L V.R
V.B
V.T
n Would like to:
n Specify drawing in world coordinates
n Display in screen coordinates
n Need some sort of mapping
n Called Window-to-viewport mapping
n Basic W-to-V mapping steps:
n Define a world window
n Define a viewport
n Compute a mapping from window to viewport
n How is window-to-viewport mapping done?
n Trigonometry: derive Window-to-Viewport mapping
n Basic principles:
n Calculate ratio: proportional mapping ratio (NO distortion)
n Account for offsets in window and viewport origins
n You are given:
n World Window: W.R, W.L, W.T, W.B
n Viewport: V.L, V.R, V.B, V.T
n A point (x,y) in the world
n Required: Calculate corresponding point (s.x, s.y) in screen
coordinates
(x,y) (sx,sy)
W.T-W.B
W.R-W.L
V.T-V.B
V.R-V.L
Solve, given the formulas:
What is (Sx,Sy) for point (3.4,1.2) in world coordinates if:
Solution:
Sx Ax A W L V L
Sy By B W B V B
Sx = 80 x + 60 = 332 Sy =^80 y +^80 =^176
Hence, point (3.4,1.2) in world = point (332,176) on screen