Line and Character Attributes 2-D Transformation

Slides:



Advertisements
Similar presentations
Computer Graphics: 2D Transformations
Advertisements

COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Gursharan Singh Tatla TRANSFORMATIONS Gursharan Singh Tatla Gursharan Singh Tatla.
Geometric Transformations
1 Computer Graphics Chapter 6 2D Transformations.
Two-Dimensional Geometric Transformations
2D TRANSFORMATIONS. 2D Transformations What is transformations? –The geometrical changes of an object from a current state to modified state. Why the.
2D TRANSFORMATIONS.
CS 376 Introduction to Computer Graphics 02 / 09 / 2007 Instructor: Michael Eckmann.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
Computer Graphics with OpenGL 3e
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Mathematical Fundamentals
5.2 Three-Dimensional Geometric and Modeling Transformations 2D3D Consideration for the z coordinate.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
1 CMT Fundamentals of Computer Graphics Revision Dr. Xiaohong Gao BG---Room 2C23 Week 11.
Transformation of Graphics
2D Transformation of Graphics
Lecture Notes: Computer Graphics.
2D Geometric Transformations
Part7: Geometric Transformations
 2D Transformations 2D Transformations  Translation Translation  Rotation Rotation  Scaling Scaling.
Geometric Transformations
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Introduction to Computer Graphics Geometric Transformations
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates.
Geometric Transformations
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Homogeneous Coordinates and Matrix Representations Cartesian coordinate (x, y, z) Homogeneous coordinate (x h, y h, z h, h) Usually h = 1. But there are.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
2D Transformations What is transformations? The geometrical changes of an object from a current state to modified state. Why the transformations is needed?
Computer Graphic 2 D Transformation.
CSCE 441 Computer Graphics: 2D Transformations
Instructor: Dr. Shereen Aly Taie Basic Two-Dimensional Geometric Transformation 5.2 Matrix Representations and Homogeneous Coordinates 5.3 Inverse.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Computer Graphics 2D Transformations
Transforms.
Geometric Transformations
Geometric Transformations Hearn & Baker Chapter 5
2D TRANSFORMATIONS.
2D Transformations By: KanwarjeetSingh
2D Geometric Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
2D Transformations with Matrices
3D Transformation.
Computer Graphics Lecture 18 3-D Transformations-II Taqdees A
Computer Graphics 3D Transformations
3D Geometric Transformations
Chapter 5 2-D Transformations.
Computer Graphics Transformations.
Introduction to Computer Graphics CS 445 / 645
Lecture 7 Geometric Transformations (Continued)
2D Transformations y y x x y x.
Geometric Objects and Transformations (II)
Image manipulation via matrices
TWO DIMENSIONAL TRANSFORMATION
Presentation transcript:

Line and Character Attributes 2-D Transformation

Attributes: In general, any parameter that affects the way a primitive is to be displayed is referred to as an attribute parameter. Line Attributes: Basic attributes of a straight line segment are its type, its width, its color. Line type: Possible selection of a line-type attribute include solid lines, Dashed Lines and Dotted Lines. Line Width: The value of line width is used by line drawing algorithms to control the thickness of lines generated with subsequent output primitive commands. Line Color: The value of line color basically gives the color of the line.

Character Attributes: The appearance of displayed characters is controlled by attributes such as font, Size, Color and Orientation. Font: Character font will give the font using which the character will be displayed(Times New Roman, Arial and other etc) Size: Size will give the size of the character in which the text or a character will be displayed. Color: Gives the color of the text. Orientation: will arrange character strings vertically or horizontally

Anti aliasing: There are techniques that can greatly reduce aliasing artifacts and improve the appearance of images without increasing their resolution. These techniques are collectively referred to as anti-aliasing techniques. Pre-Filtering and Post filtering: These are the two types of general purpose anti aliasing techniques. The concept of filtering originates from the field of signal processing, where true intensity values are continuous signals that consist of elements of various frequencies. Constant intensity values that correspond to a uniform region are at the low end of the frequency range.\ Frequency values that change abruptly and correspond to sharp edge are at a high end of spectrum.

Transformation: Fundamental to all the computer graphics system is the ability to simulate the manipulation of objects in space. This simulated spatial manipulation is referred to as transformation. There are two complementary points of view for describing object transformation. 1) The object itself is transformed relative to a stationary co-ordinate syatem or back ground.(Geometric transformation) 2) the object is held stationary while the co-ordinate system is transformed relative to the object.(Co-ordinate transformation)

Various Geometric transformation Translation Scaling Rotation Shearing Reflection

Geometric Transformation: Translate Shear Rotate Scale

If we define the translation matrix , then we have P’ =P + T. Translate Points Recall.. We can translate points in the (x, y) plane to new positions by adding translation amounts to the coordinates of the points. For each point P(x, y) to be moved by tx units parallel to the x axis and by ty units parallel to the y axis, to the new point P’(x’, y’ ). The translation has the following form: P(x,y) P’(x’,y’) tx ty In matrix format: If we define the translation matrix , then we have P’ =P + T.

We can specify how much bigger or smaller by means of a “scale factor” Scale Points Points can be scaled (stretched) by sx along the x axis and by sy along the y axis into the new points by the multiplications: We can specify how much bigger or smaller by means of a “scale factor” To double the size of an object we use a scale factor of 2, to half the size of an object we use a scale factor of 0.5 P(x,y) P’(x’,y’) x sx x sy y y If we define , then we have P’ =SP

Rotation: A two dimensional Rotation is applied to an object by repositioning it along a circular path in the xy plan. To generate a rotation we specify a rotation angle סּ and the position (xr,yr) of the rotation point about which the object is to be rotated. Positive values to the rotation angle define counterclockwise rotation about the pivot point and negative values rotate object in clockwise direction.

P(x,y) P’(x’,y’) x x’ y’ y   O We can express the transformed coordinates in terms of angles סּ and  as X’=rcos( + סּ)=r cos  cos סּ - r sin  sin סּ Y’= rsin( + סּ)=r cos  sin סּ + r sin  cos סּ The original coordinate of the point in polar coordinate are: x=r cos  and y=r sin  x’= x cos סּ -ysin סּ y’= x sin סּ +y cos סּ

P’=R.P Rotation of a point about any specified rotation position(xr,yr) x’= xr+(x-xr) cos סּ - (y-yr)sin סּ y’= yr+(x-xr) sin סּ + (y-yr)cos סּ Translate: P’ = P+T Scale: P’ = SP Rotate: P’ = RP P’ =R.P

Matrix Representation and Homogeneous Co-ordinates Many graphics application involve sequence of geometric transformations. An animation, for example might require an object to be translated and rotated at each increment of the motion. P’=M1*P+M2 Two express any two-dimensional transformation as a matrix multiplication we represent cartesian co-ordinate (x,y) with the homogeneous co-ordinate triple(xh,yh,h) Expressing positions in homogeneous co-ordinates allows us to represent all the geometric transformation equations as matrix multiplications.

Homogeneous Transformations Now, redefine the translation by using homogeneous coordinates: Similarly, we have: Scaling Rotation P’ = S  P P’ = R  P

Composite Transformation: We form composite transformations by multiplying matrices in order from right to left. Translations: if two successive translation vectors(tx1,tx1) and (tx2,tx2) are applies to a co-ordinate position P, the final Transformed location p’ is calculated as P’=T(tx2,ty2).T(tx1,ty1).p T(tx2,tx2).T(tx1,ty1)=T(tx1+tx2,ty1+ty2) Which Proves two successive translation are additive. Rotation: Two successive rotation are additive Scaling two successive scaling are multiuplicative.

General Fixed –Point Scaling Above is the illustration of a transformation sequence to produce Scaling with respect to a selected fixed position (x,y) using Scaling function that can only Scale relative to the co-ordinate origin. Translate object so that the fixed point Co-incides with the co-ordinate origin. Scale the object with respect to the co-ordinate origin Use the inverse Translation of step 1 to return the object to its original position.

Inverse of transformation: Translation= -tx,-ty Scaling=1/sx,1/sy Rotation=- סּ

Magnify a triangle with vertices A(0,0) B(1,1) and C(5,2) to twice its size while keeping C(5,2) as fixed. Perform a 45 degree rotation of the same triangle About origin and about point(-1,-1). Cos 45 and sin 45(root(2)/2)

Reflection: A reflection is a transformation that produces a mirror image of an object. The mirror image for a two-dimensional reflection is generated relative to an axis of reflection by rotating the object about the reflection axis. 1) Reflection about the y=0 , the x-axis is accomplished with the transformation matrix

A Reflection about y-axis flips x-co-ordinates while keeping y-co-ordinate the same the matrix for this transformation is: We flip both the x and y co-ordinates of a point by reflecting relative to an axis that is perpendicular to the xy plane and that passes through the co-ordinate origin. Transformation relative to the co-ordinate origin

Reflection Axis as the diagonal line y=x