Presentation is loading. Please wait.

Presentation is loading. Please wait.

Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.

Similar presentations


Presentation on theme: "Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords."— Presentation transcript:

1 Viewing CS418 Computer Graphics John C. Hart

2 Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion

3 Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion

4 Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion M

5 Transformation Order M 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); M RT M TR

6 Viewing Transformation Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion

7 Viewing Transformation Model Coords World Coords Viewing Coords Clip Coords Screen Coords x y z x y lookat point eye point

8 x y z World Coordinates Viewing Coordinates x y z eye pointlookat pointeye point (at origin) lookat point (along –z axis)

9 x y z World Coordinates Viewing Coordinates x y eye pointlookat point (along –z axis)

10 x y z World Coordinates Viewing Coordinates x y eye pointlookat point y' x' Why not these axes?

11 x y z World Coordinates Viewing Coordinates y z eye pointlookat point up vector up 1.Specify up direction in world coordinates 2.Transform up vector into viewing coordinates 3.Rotate about z-axis until up vector in x-y plane. x

12 x y z World Coordinates Viewing Coordinates y z eye pointlookat point up vector up 1.Specify up direction in world coordinates 2.Transform up vector into viewing coordinates 3.Rotate about z-axis until up vector in x-y plane. x

13 Lookat Transformation x y z lookat point eye point up vector

14 Lookat Transformation 1.Translate the eye point to the origin x y z

15 Lookat Transformation 1.Translate the eye point to the origin 2.Rotate the view vector into the negative z-axis x y z x y z

16 Easier Way Orthogonalize lookat vector system x y z up v

17 Easier Way Orthogonalize lookat vector system –Let r = v  up/||v  up|| x y z up r v

18 Easier Way Orthogonalize lookat vector system –Let r = v  up/||v  up|| –Let u = r  v x y z up u v r

19 Easier Way Orthogonalize lookat vector system –Let r = v  up/||v  up|| –Let u = r  v –Create rotation matrix from to R r = x, R u = y, R v = -z x y z up u v r

20 Construct Lookat Translate eye point to origin Rotate view into -z axis –Let v = (lookat - eye)/||lookat - eye|| –Let r = v  up/||v  up|| –Let u = r  v x y z x y z lookat point eye point up vector

21 Viewing Transformation Model Coords World Coords Viewing Coords Clip Coords Screen Coords x y z x y z lookat point eye point


Download ppt "Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords."

Similar presentations


Ads by Google