Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 Basic geometric objects

Similar presentations


Presentation on theme: "Lecture 5 Basic geometric objects"— Presentation transcript:

1 Lecture 5 Basic geometric objects
Computer Graphics Lecture 5 Basic geometric objects

2 Basic Geometric Objects
The basic geometric objects in computer graphics are usually called primitives or graphics output primitives. The basic primitives are the following ones. Points that are uniquely defined by their x- and y-coordinate. Points are usually not drawn themselves. Their main function is the description of other objects like lines that can be defined by their two endpoints. Lines, polylines or curves can be defined by two or more points. Whereas for a line two points are needed, curves require additional control points. Polylines are connected sequences of lines. Areas are usually bounded by closed polylines or polygons. Areas can be filled with a colour or a texture.

3 The simplest curve is a line segment or simply a line.
A sequence of line where the following line starts where the previous one ends is called a polyline. If the last line segment of a polyline ends where the first line segment started, the polyline is called a polygon. A polygon or, more generally, an area or a region is convex if whenever two points are within the region the connecting line between these two points lies completely inside the region as well.

4 Figure shows a self-overlapping polygon, a nonconvex polygon and a convex polygon

5 For the non convex polygon two points inside the polygon are chosen and connected by a dotted line that lies not completely inside the polygon. The curve begins and ends in the two specified endpoints. In addition to the endpoints of the curve, one or more control points have to be specified. The control points define the direction of the curve in the two endpoints.

6 Two Types of Curves Quadratic curve - consists of one control point
and two endpoints. 2. Cubic curve – consists of two control points

7 Other important curves in computer graphics are circles, ellipses and circular and elliptic arcs, axes-parallel rectangles. Instead of specifying a polygon or the boundary directly in order to define an area, it is sometimes more convenient to construct a more complicated area by combining previously defined areas using set-theoretic operations. The most important operations are - union - intersection - difference - symmetric difference

8 The union joins two areas to a larger area.
Intersection consists of the part belonging to both areas. The difference of an area with another removes all parts from the first area that also belong to the second area. The symmetric difference corresponds to a pointwise exclusive OR-operation applied to the two areas. The symmetric difference is the union of the two areas without their intersection.

9 Figure shows the results of applying these operations to two areas in the form of a circle and a rectangle

10 Geometric Transformations
Transform – to change. Geometric Transformations – are used to: - change size, shape, orientation or position of the graphical objects. - change the coordinate positions of the objects. - construct new areas from already existing ones.

11 Types of Transformations
Translation Rotation Scaling Reflection Shearing

12 We can represent a point in the plane as
a column vector a row vector

13 Translation Translation means changing the position of an object.
Moving the object from one place to another. It is applied by repositioning the object along a straight line path from one coordinate location to another. Translation is done by adding translation distances to both coordinate points (x,y) That is, x’ = x + tx y’ = y + ty

14 The translation distance pair (tx, ty) is called translation vector or shift vector.
Translation moves the objects without deforming them. It means it moves every point of object by same amount.

15 Point Translation

16 Line Translation Is done by applying the translation distance to both endpoints of a line. x1’ = x1 + tx1 y1’ = y1 + ty y x2’ = x2 + tx2 (x2, y2) (x2’, y2’) y2’ = y2 + ty2 (x1, y1) (x1’, y1’) x


Download ppt "Lecture 5 Basic geometric objects"

Similar presentations


Ads by Google