1 l
play

1 L Mar-4-05 SMM009, Exam Review Overview Working problems - PDF document

INSTITUTIONEN FR SYSTEMTEKNIK LULE TEKNISKA UNIVERSITET Exam Review David Carr Virtual Environments, Fundamentals Spring 2004 1 L Mar-4-05 SMM009, Exam Review Overview Working problems Summary of the course 2 L Mar-4-05


  1. INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Exam Review David Carr Virtual Environments, Fundamentals Spring 2004 1 L Mar-4-05 SMM009, Exam Review Overview • Working problems • Summary of the course 2 L Mar-4-05 SMM009, Exam Review INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Summary 3 L Mar-4-05 SMM009, Exam Review 1

  2. Elements of Image Formation • Objects • Viewer • Light source(s) • Attributes that govern how light interacts with the materials in the scene • Note the independence of the objects, viewer, and light source(s) 4 L Mar-4-05 SMM009, Exam Review Three-Color Theory • Human visual system has two types of sensors - Rods: monochromatic, night vision - Cones + Color sensitive + Three types of cone + Only three values (the tri stimulus values) are sent to the brain • Need only match these three values - Need only three primary colors 5 L Mar-4-05 SMM009, Exam Review Pinhole Camera & Synthetic Camera Model projector Use trigonometry to find projection of a point p x p = -x/z/d y p = -y/z/d z p = d image plane projection of p center of projection These are equations of simple perspective 6 L Mar-4-05 SMM009, Exam Review 2

  3. Following the Pipeline: Transformations • Much of the work in the pipeline is in converting object representations from one coordinate system to another - World coordinates - Camera coordinates - Screen coordinates • Every change of coordinates is equivalent to a matrix transformation 7 L Mar-4-05 SMM009, Exam Review Clipping • Just as a real camera cannot “see” the whole world, the virtual camera can only see part of the world space - Objects that are not within this volume are said to be clipped out of the scene 8 L Mar-4-05 SMM009, Exam Review Projection • Must carry out the process that combines the 3D viewer with the 3D objects to produce the 2D image - Perspective projections: all projectors meet at the center of projection - Parallel projection: projectors are parallel, center of projection is replaced by a direction of projection 9 L Mar-4-05 SMM009, Exam Review 3

  4. Rasterization • If an object is visible in the image, the appropriate pixels in the frame buffer must be assigned colors - Vertices assembled into objects - Effects of lights and materials must be determined - Polygons filled with interior colors/shades - Must have also determine which objects are in front (hidden surface removal) 10 L Mar-4-05 SMM009, Exam Review Geometry and Representation • Geometry - Relationships among objects in an n-dimensional space - In computer graphics, objects exist in 3 dimensions - Minimum set of primitives for building more sophisticated objects + Scalars, Vectors, Points • Representations - Dimension and basis - Coordinate systems for representing vectors spaces - Frames for representing affine spaces - Change of frames and basis - Homogeneous coordinates 11 L Mar-4-05 SMM009, Exam Review Affine Spaces • Point + a vector space • Operations - Vector-vector addition → vector - Scalar-vector multiplication → vector - Point-vector addition → point - Scalar-scalar operations → scalar • For any point P and the scalars 0,1 define - 1 • P = P - 0 • P = 0 (zero vector) 12 L Mar-4-05 SMM009, Exam Review 4

  5. Convexity • An object is convex if and only if for any two points in the object all points on the line segment between these points are also in the object P P Q Q 13 L Mar-4-05 SMM009, Exam Review Planes • A plane be determined by a point and two vectors or by three points P( α , β )=R+ α u+ β v P( α , β )=R+ α (Q-R)+ β (P-Q) 14 L Mar-4-05 SMM009, Exam Review Normals • Every plane has a vector n normal (perpendicular, orthogonal) to it • From point-two vector form P( α , β ) = R + α u + β v, we know we can use the cross product to find n = u × v and the equivalent form (P( α )-P) × n = 0 v u P 15 L Mar-4-05 SMM009, Exam Review 5

  6. Frames • Coordinate System is insufficient to present points • If we work in an affine space we can add a single point, the origin , to the basis vectors to form a frame • Frame determined by (P 0 , v 1 , v 2 , v 3 ) • Within this frame, every vector can be written as v 2 v = α 1 v 1 + α 2 v 2 + … + α n v n v 1 P 0 • Every point can be written as P = P 0 + β 1 v 1 + β 2 v 2 + … + β n v n v 3 16 L Mar-4-05 SMM009, Exam Review A Single Representation • If we define 0•P = 0 and 1•P = P then we can write v = α 1 v 1 + α 2 v 2 + α 3 v 3 = [ α 1 α 2 α 3 0] [ v 1 v 2 v 3 P 0 ] T P = P 0 + β 1 v 1 + β 2 v 2 + β 3 v 3 = [ β 1 β 2 β 3 1] [ v 1 v 2 v 3 P 0 ] T • Thus we obtain the four-dimensional homogeneous coordinate representation v = [ α 1 α 2 α 3 0] T p = [ β 1 β 2 β 3 1] T 17 L Mar-4-05 SMM009, Exam Review Homogeneous Coordinates • The general form of 4 dimensional homogeneous coordinates is p=[x y x w] T • We return to a three dimensional point (for w ≠ 0 ) by x ← x/w y ← y/w z ← z/w • If w=0 , the representation is that of a vector • Note that homogeneous coordinates replaces points in three dimensions by lines through the origin in four dimensions 18 L Mar-4-05 SMM009, Exam Review 6

  7. Working with Representations Within the two frames any point or vector has a representation of the same form a = [ α 1 α 2 α 3 α 4 ] in the first frame b = [ β 1 β 2 β 3 β 4 ] in the second frame where α 4 = β 4 = 1 for points and α 4 = β 4 = 0 for vectors and a=M T b The matrix M is 4 x 4 and specifies an affine transformation in homogeneous coordinates 19 L Mar-4-05 SMM009, Exam Review Affine Transformations • Every linear transformation is equivalent to a change in frames • Every affine transformation preserves lines • However, an affine transformation has only 12 degrees of freedom because 4 of the elements in the matrix are fixed and are a subset of all possible 4 x 4 linear transformations 20 L Mar-4-05 SMM009, Exam Review Matrix Representation in 4D Homogeneous Coordinates • This form is better for implementation because: - All affine transformations can be expressed this way - Multiple transformations can be concatenated together • Translation 1 0 0 d � � x � � 0 1 0 d y � � 0 0 1 d � � z � � 0 0 0 1 � � 21 L Mar-4-05 SMM009, Exam Review 7

  8. Rotation About the Z-Axis • Rotation about z axis in three dimensions leaves all points with the same z - Equivalent to rotation in 2 dimensions in planes of constant z x’ = x cos θ – y sin θ y’ = x sin θ + y cos θ z’ = z cos sin 0 0 � � � � � � � • x- and y-axes similar sin cos 0 0 � � � � R z ( θ ) = 0 0 1 0 � � � � 0 0 0 1 � � 22 L Mar-4-05 SMM009, Exam Review Scaling • Expand or contract along each axis (fixed point of origin) • Reflections are negative scaling x’=s x x y’=s y y z’=s z z s 0 0 0 � � x p ’= Sp � � 0 s 0 0 y � � S = S (s x , s y , s z ) = 0 0 s 0 � � z � � 0 0 0 1 � � 23 L Mar-4-05 SMM009, Exam Review Shear • Equivalent to pulling faces in opposite directions • On the x-axis 1 cot 0 0 � � � x’ = x + y cot θ � � 0 1 0 0 � � H ( θ ) = y’ = y 0 0 1 0 � � z’ = z � � 0 0 0 1 � � 24 L Mar-4-05 SMM009, Exam Review 8

  9. Inverses • Could compute inverse matrices by general formulas, • But, simple geometric observations are easier - Translation: T -1 (d x , d y , d z ) = T (-d x , -d y , -d z ) - Rotation: R -1 ( θ ) = R (- θ ) +Holds for any rotation matrix +Note that since cos(- θ ) = cos( θ ) and sin(- θ )=-sin( θ ), R -1 ( θ ) = R T ( θ ) - Scaling: S -1 (s x , s y , s z ) = S (1/s x , 1/s y , 1/s z ) 25 L Mar-4-05 SMM009, Exam Review Concatenation • Form arbitrary affine transformation matrices by multiplying - Rotation, translation, and scaling matrices • Same transformation is applied to many vertices: - Cost of forming a matrix M=ABCD is not significant compared to the cost of computing Mp for many vertices p • Difficulty is forming a desired transformation • Order of Transformations - Note that matrix on the right is the first applied - Mathematically, the following are equivalent p ’ = ABCp = A ( B ( Cp )) - Note many references use column matrices to present points. In terms of column matrices p T ’ = p T C T B T A T 26 L Mar-4-05 SMM009, Exam Review Projection Perspective Parallel 27 L Mar-4-05 SMM009, Exam Review 9

  10. Three Aspects of Computer Viewing • Positioning the camera - Setting the model-view matrix • Selecting a lens - Setting the projection matrix • Clipping - Setting the view volume • All are implemented in the pipeline • Default OpenGL projection is Orthogonal Projection orthogonal 28 L Mar-4-05 SMM009, Exam Review Projections and Normalization • The default projection in the eye (camera) frame is orthogonal • For points within the default view volume x p = x 1 0 0 0 � � � � 0 1 0 0 y p = y � � M = � 0 0 0 0 � z p = 0 � � 0 0 0 1 � � • Most graphics systems use view normalization - All other views are converted to the default view by transformations that determine the projection matrix - Allows use of the same pipeline for all views 29 L Mar-4-05 SMM009, Exam Review Simple Perspective • Center of projection at the origin • Projection plane z = d , d < 0 • Consider top and side views x x p = z / d y y p = z / d z p = d 30 L Mar-4-05 SMM009, Exam Review 10

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend