Download presentation
Presentation is loading. Please wait.
Published byBernice Richard Modified over 8 years ago
1
Viewpoints and Transformations CSIS 5838: Graphics and Animation for Gaming
2
Coordinate Systems Object Space: Coordinate space of an individual mesh – Edit mode in Blender Translating/rotating/scaling in this space changes location of individual vertices in this coordinate system – Usually with respect to some “object center” Howard Hamilton, University of Regina
3
Coordinate Systems World Space: Overall coordinate space of all elements – Object mode in Blender Translating/rotating/scaling object in this space changes object space relative to world space – “Object center” manipulated – All vertices move with center Howard Hamilton, University of Regina
4
Coordinate Systems Image Space: Coordinate system from POV of viewer/camera – Camera view in Blender Convention: Center of Interest (COI) along z-axis in this space Moving camera/viewpoint changes this space relative to world space Howard Hamilton, University of Regina
5
Affine Transformations Transformation between coordinate systems using matrix multiplication General affine transformation of point (x, y, z) in one coordinate system to (x’, y’, z’) in another coordinate system:
6
Translation and Scaling Translation by [p, q, r]: Scaling by [p, q, r]:
7
Rotation About Different Axes By α around x-axis: By α around z-axis:
8
Combined Transformations Can combine all transformation into single matrix with multiplication M obj2world = M objtrans x M objscale x M objrotX x M objrotY x M objrotZ M world2eye = M worldtrans x M worldscale x M worldrotX x M worldrotY x M worldrotZ M obj2eye = M obj2world x M world2eye Efficiency: – Compute M obj2world for each object – Compute M world2eye once for entire world – Compute M obj2eye for each object – Apply M obj2eye to each vertex in each object
9
The Rendering Pipeline Conversion of vertices, etc. on mesh in object space to world space Projection of points in 3D world space into 2D image space Other modifiers – Surface features (colors, UV images etc.) – Transformation of apparent surfaces (smoothing, etc.) –…–…
10
Visual Frustum Area of world rendered to screen (“field of view”) Near clip plane = image plane (where image “projected”) Far clip plane = limit of view – Nothing further from camera rendered – Also nothing outside of “cone” rendered
11
Orthographic vs. Perspective View Projecting vertices in 3D image space to 2D image plane Orthographic view: (x, y, z) in image space (x, y) on image plane – No foreshortening – Makes editing objects simpler blender.org
12
Perspective View “Normal” vision with foreshortening Image projected to point representing location of viewer Focal length f = distance between viewer and image plane – Smaller f = more foreshortening blender.org
13
Perspective Transformation Foreshortening: (x, y, z) in image space (xf/z, yf/z) on image plane gamedev.com
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.