1 / 53

Computer Animation

Computer Animation. Computer Graphics Basics. Terms. Raster - set of horizontal scan lines on a display Scan line - row of individual pixels Pixel - picture element; smallest directly addressable element in a raster Scan Conversion - determining which pixels to set, and with what values.

cadman-buck
Télécharger la présentation

Computer Animation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Animation Computer GraphicsBasics

  2. Terms • Raster - set of horizontal scan lines on a display • Scan line - row of individual pixels • Pixel - picture element; smallest directly addressable element in a raster • Scan Conversion - determining which pixels to set, and with what values

  3. Scale Rotate Translate 3-D 3-D Scale Rotate 3-D Object Space World Space Eye Space Projection Change coordinate system 2-D 2-D Screen Space Normalized Eye Space Viewing pipeline

  4. Coordinate systems • Object/World/Eye • real coordinates • infinite in all directions • Normalized • real coordinates • world and screen independent • Screen • integer coordinates • finite in all directions

  5. Vectors • A point is most oftened represented by a coordinate tuple • In 2D graphics that would be (x, y)

  6. Vectors • This tuple can either be interpreted as an actual point P, or … • As a vector that when applied to a coordinate system’s origin O, takes you to the point P = (x, y) O

  7. Vectors • Vectors can be transformed to allow for - Scaling - Rotation - Translation - Shearing - Etc. P = (x, y) O

  8. Vectors • Vectors can also be represented by a single column matrix P = (x, y) O

  9. Scaling Sx = 2, Sy = 1 P’ = (Sxx, Sy y) • x and y are mulitplied by scalar values Sx and Sy, respectively • This allows for the magnitude in each dimension to be changed independently P = (x, y) O

  10. Scaling • Scaling can also be accomplished via matrix muliplication O

  11. Rotation • Rotation is moving a point P about an origin O • That is, changing the direction of the vector but not it’s magnitude O

  12. Rotation • The equations for rotation are ...  O

  13. Rotation • Using matrices ...  O

  14. Translation • Offsetting (moving) a point from one place to another • Tx and Ty are added to x and y, respectively • x’ = Tx + xy’ = Ty + y O

  15. Translation • In order to use matrix multiplication, • We need to extend our point vector to create homogeneous coordinates O

  16. Polygons • All vertices (points) are represented by vectors • All vertices have the same transformations applied to them

  17. Preferred order • If we rotate before scaling, … • Our shapes lose their integrity O • So, we scale first, then rotate

  18. Preferred order • If we translate before rotating, … • Our shapes are not placed correctly O • Why? Because you end up rotating the translation vector as well!

  19. 3-D coordinates • Normal (x,y,z) • Homogeneous (x,y,z,h)

  20. 3-D World Coordinate Systems • Same as for 2-D, with the addition of a z-axis • Two orientations are generally used • Right-handed • Left-handed • For each, the thumb points in the +x direction, the pointer finger is +y, and the middle finger is +z

  21. +Y +Y +Z +X +X +Z 3-D World Coordinate Systems Right-handed Left-handed

  22. Projections • Perspective • One-point • Two-point • Three-point • Parallel • Orthographic • Top (plan) • Front elevation • Side elevation • Axonometric • Isometric

  23. Orthographic projection • Side • Front • Top • Normals and projections in same direction • Side, front and top views

  24. Orthographic projection • Axonometric • Projection planes are not normal to principal axis • Show several faces at once • Isometric • Projection-plane normal makes equal angles with each principal axis

  25. Perspective projection y z-axis vanishing point x z

  26. Viewing Volume view reference point • Starting with a projection reference point (PRP) we trace four lines, one through each corner of the window • The window in located on the view plane • The resulting pyramid is called a view volume projection reference point

  27. Projecting an image • The first step in rendering 3-D images, is to project the object onto the 2-D view plane

  28. Projecting an image • The distance from the PRP to the view plane is called the viewing distance z yp y viewingdistance (d)

  29. Projecting an image • The position of a point, as projected on the view plane, is computed by ...

  30. Projecting an image • Using matrices … • We create an intermediate vector • Dividing this vector by z /d yields our projected point

  31. Frustum View Volume • The viewing volume is turned into a frustum by adding front and back planes • Only objects within the frustum are visible back view plane front prp

  32. Parallelpiped View Volume • Adjacent sides are at right angles to each other • A frustum to parallelpiped transformation is accomplished via scaling or shearing and scaling prp front vp back

  33. Parallelpiped View Volume • Simple case: only scaling • Caution!Division by zero up ahead! • Go review earlier discussion yp y z d

  34. Generalized Transformation • Q : What happens when the viewing vector is not perpendicular to the viewplane? • A : First Shear and then Scale!

  35. First, Shear vp

  36. First, Shear vp

  37. Mshear

  38. Then, Scale vp

  39. Then, Scale vp

  40. Mscale

  41. Normalized View Volume

  42. Modeling Coordinates World Coordinates Eye Coordinates Projection Coordinates Normalized Coordinates Screen Coordinates Viewing Pipeline Question?What operations move us from one system to the next?

  43. Curves • Parametric • Hermite • Bezier • B-spline

  44. Parametric Representation Pn • For a given curve, each point Pk=(xk, yk, zk) can be represented by a set of parametric equations • For cubic interpolations, these take the form of:x(u) = axu3 + bxu2 + cxu + dxy(u) = ayu3 + byu2 + cyu + dyz(u) = azu3 + bzu2 + czu + dz P0 Pk

  45. Hermite Interpolation • A curve segment is defined by two, consecutive points on a curve • P(0) = pkP(1) = pk+1P´(0) = pkP´(1) = pk+1

  46. Hermite Interpolation

  47. Hermite Interpolation

  48. Hermite Interpolation • The polynomials that result from expanding the equation …[u3 u2 u 1]MH GH= Hk(u)are termed blending functions

  49. Bézier CurvesProperties • Always passes through first and last control points p1 p´2 p2 p´0 p0 p´1 • Displays C1 continuity where segments join (same slope)

  50. Bézier Curves • Based on a series of blending functions, BEZk,n(u) = C(n,k)uk(1-u)n-k • Where ... • Such that ... • This is for n+1 control points

More Related