Computer Graphics, KKU. Lecture 41 The Computer Programming Laws Any given program, when running, is obsolete. Any given program costs more and takes longer. If a program is useful, it will have to be changed. If a program is useless, it will have to be documented. Any given program will expand to fill all available memory. The value of a program is proportional to the weight of its output. Program complexity grows until it exceeds the capability of the programmer who must maintain it.
Computer Graphics, KKU. Lecture 42 Points One of the fundamental objects in 3D space that has position. The basis for all operation in computer graphics. Distinguished from each other with its position. Drawn as dots. Denoted by capitalized bold letters such as P and Q. If the Cartesian coordinate system is chosen, we represent points componentwise by utilizing parenthesis e.g ( x,y,z ).
Computer Graphics, KKU. Lecture 43 Trigonometry
Computer Graphics, KKU. Lecture 44 Polar Coordinates
Computer Graphics, KKU. Lecture 45 Parametric Functions
Computer Graphics, KKU. Lecture 46 Parametric Lines
Computer Graphics, KKU. Lecture 47 Parametric Circles
Computer Graphics, KKU. Lecture 48 Plotting Parametric Functions
Computer Graphics, KKU. Lecture 49 The fundamental 3D space objects like points. Has both magnitude and direction. But positionless. Drawn as lines segments with arrow. Denoted by lower case letters with an arrow above such as we represent vectors componentwise by utilizing brackets e.g. For each pair of point P and Q, there exists a unique vector such that Vectors
Computer Graphics, KKU. Lecture 410 Vectors
Computer Graphics, KKU. Lecture 411 Properties of Vectors
Computer Graphics, KKU. Lecture 412 Properties of Vectors (Cont.)
Computer Graphics, KKU. Lecture 413 “Multiplying” Vectors
Computer Graphics, KKU. Lecture 414 Vector Projection
Computer Graphics, KKU. Lecture 415 Planes
Computer Graphics, KKU. Lecture 416 Planes (Cont.)
Computer Graphics, KKU. Lecture 417 Matrices
Computer Graphics, KKU. Lecture 418 Matrix Multiplication
Computer Graphics, KKU. Lecture 419 Matrices (Cont.)
Computer Graphics, KKU. Lecture 420 Matrix Inversion
Computer Graphics, KKU. Lecture 421 Cartesian coordinate system Frame-based coordinate system Device space Screen Space Image Space Object Space World Space Coordinate Systems
Computer Graphics, KKU. Lecture 422 Cartesian coordinate system Right-hand system z xy x z y
Computer Graphics, KKU. Lecture 423 Cartesian coordinate system(Cont.) In the computer graphics community In computer graphics Right-hand system z x y x z y
Computer Graphics, KKU. Lecture 424 Frame-based coordinate system Consists of an origin and linearly independent vectors
Computer Graphics, KKU. Lecture 425 The actual coordinate system by which points are plotted on the graphics device. Measured in pixels On SGI machines –(0,0) is the lower left corner of a window. –X value increases to the right. –Y value increases upward. On Window platform –(0,0) is the upper left corner of a window. –X value increases to the right. –Y value increase downward. Device Space x x y y
Computer Graphics, KKU. Lecture 426 Screen Space Defined to be the square on the xy plane. Mapped to device space by most drivers for specific graphics devices
Computer Graphics, KKU. Lecture 427 Image Space Used in 3-D system to allow for depth calculations. Defined by Points in this space are mapped onto screen space by projecting them onto the plane. For example, any point in image space will be protected to the center of the display screen.
Computer Graphics, KKU. Lecture 428 World Space The coordinate system of the scene Must be projected into image space for viewing.
Computer Graphics, KKU. Lecture 429 Object Space Localized system of an object being created. After objects are created, about the world space they can be –transformed –duplicated –moved –.etc
Computer Graphics, KKU. Lecture 430 Affine Space Made up of points and vectors In affine space,
Computer Graphics, KKU. Lecture 431 Affine Space (Cont.) Vectors can be added, but points cannot. Vectors can be scaled, but point cannot. That is
Computer Graphics, KKU. Lecture 432 What is Affine Combination? If are points andare scalars such that then is defined to be the point
Computer Graphics, KKU. Lecture 433 Affine Combination of 2 Points Let P 1 and P 2 be points in an affine space, Consider the expression This P point represents a point on the line that passes through P 1 and P 2 Note that if then P is somewhere on the line segment joining P 1 and P 2.
Computer Graphics, KKU. Lecture 434 Affine Combination of 3 Points Consider three points P 1 P 2 and P 3 that form a triangle, a point P can be defined by or then the point will be within (or on the boundary) of the triangle. If
Computer Graphics, KKU. Lecture 435 Convex VS Non-Convex Convex SetNon-Convex Set
Computer Graphics, KKU. Lecture 436 Coordinates of a point in the frame Given a frame, a point P can be written asWhere O is an origin of the frame and so the point can be written uniquely as The set of values are the coordinates of P relative to the frame.
Computer Graphics, KKU. Lecture 437 Cartesian Frames The 2D standard Cartesian frame, denoted as, has A point P = will has the coordinate (x,y) relative to this frame A Cartesian frame with any dimension consists of (0,0,…..,0) as an origin,,…, as basis vectors
Computer Graphics, KKU. Lecture 438 Examples Given the frame which has the origin (0,0) and the vectors u = and v =, the point P that has its coordinate (5,3) in this frame, can be written as which is the Cartesian coordinate (8,3). or
Computer Graphics, KKU. Lecture 439 Matrix Representation of Points Given a frame in an affine space, we can write a point P uniquely as or
Computer Graphics, KKU. Lecture 440 Matrix Representation of Vectors Given a frame in an affine space, we can write a vector v uniquely as or
Computer Graphics, KKU. Lecture 441 Converting between Frames Suppose that we have the point P, with coordinates (3,2) in the frame. What are the coordinates of the point in the frame ? Consider the two frames and _ where
Computer Graphics, KKU. Lecture 442