Upload
jack-page
View
215
Download
1
Embed Size (px)
Citation preview
Glut Coordinate System
Used in keyboard and mouse callbacks
x
y
w
h[window]
Fall 2013 revised 2
Recall OpenGL Rendering Pipeline
stages of vertex transformation
OpenGL NDC (normalized device coordinate)
x
y z
[-1,1]2 × [0,1]depth range
Near (0)
Far (1)
Note: this is a left-hand coordinate system!
Fall 2013 revised 4
Recall OpenGL Rendering Pipeline
stages of vertex transformation
OpenGL Window Coordinates
x
y z
[0,1]2
Near (0)
Far (1)
Use Mouse to Pick 2D World
x
y
xmin xmax
(mx, my)
(x, y)
0
0
minmax
min
w
mx
xx
xx
w
x
Keep all terms positive
in the formula
Use Mouse to Pick 2D World
x
y
ymin
ymax
(mx, my)
(x, y)
h
myh
yy
yy
minmax
min
h
Length ratio: take positive
valuesy
Summary
0
0
minmax
min
w
mx
xx
xx
h
myh
yy
yy
minmax
min
minmaxmin xxw
mxxx
minmaxmin yyh
myhyy