Viewing
CS418 Computer Graphics John C. Hart
Viewing CS418 Computer Graphics John C. Hart Graphics Pipeline - - PowerPoint PPT Presentation
Viewing CS418 Computer Graphics John C. Hart Graphics Pipeline Model Model World Viewing Viewing Perspective Coords Xform Coords Xform Coords Distortion Still Homogeneous Clip Clip Clipping Divide Coords. Coords. Window
CS418 Computer Graphics John C. Hart
Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window to Viewport Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion
Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window to Viewport Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion
W2V Persp View Model 1 1
s m s m m
x x y y z
Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window to Viewport Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion
1
s s
x y 1
m m m
x y z
1
s s
x y 1
m m m
x y z
x y z glutSolidTeapot(1); glRotate3f(-90, 0,0,1); glTranslate3f(0,1,0); glutSolidTeapot(1); glTranslate3f(0,1,0); glRotate3f(-90, 0,0,1); glutSolidTeapot(1);
1
s s
x y 1
m m m
x y z
1
s s
x y 1
m m m
x y z
Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window to Viewport Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion
W2V Persp View Model 1 1
s m s m m
x x y y z
W2V Model View Persp
Model Coords World Coords Viewing Coords Clip Coords Screen Coords x y z x y lookat point eye point
x y z
x y z
eye point lookat point eye point (at origin) lookat point (along –z axis)
x y z
x y
eye point lookat point lookat point (along –z axis)
x y z
x y
eye point lookat point
y' x' Why not these axes?
x y z
y z
eye point lookat point up vector up vector up
world coordinates
viewing coordinates
up vector in x-y plane.
x
x y z lookat point eye point up vector
to the origin
x y z
1 1 1 1 x y z
to the origin
into the negative z-axis
x y z
1 1 1 1 x y R z
x y z
x y z up v
– Let r = v up/||vup|| x y z up r v
– Let r = v up/||vup|| – Let u = r v x y z up u v r
– Let r = v up/||vup|| – Let u = r v – Create rotation matrix from <r,u,-v> to <x.y,z> R r = x, R u = y, R v = -z x y z up u v r
– Let v = (lookat - eye)/||lookat - eye|| – Let r = v up/||vup|| – Let u = r v x y z
x y z
lookat point eye point up vector
W2V Model View Persp
Model Coords World Coords Viewing Coords Clip Coords Screen Coords x y z x y z lookat point eye point