Graphic Pri m itives 🠶 The basic geometric objects in CG are usually called primitives or graphic output primitives 🠶 A pr i m i t i v e i s a g r a p h i cs o b j e ct t h a t i s e ss e n ti a l for t h e cr e a ti on or con s t ruc t i on of comp l e x i mag e s. 🠶 Fortunately, graphics is constructed from a few basic elements, as opposed to the great variety of graphics applications.
Points 🠶 Points are uniquely defined by their x - and y -coordinates 🠶 Points are usually not drawn themselves 🠶 Their main function is the description of other objects like lines that can be def i n e d b y t h e i r t w o e n dpo i n t s
Lines, Polylines or Curves 🠶 T h e s e c a n be def i n e d b y t w o or more po i n t s 🠶 For l i n e s t w o p o i n t s ar e n e e ded 🠶 Cur v e s n ee d t w o p o i n t s a n d a d d iti o n a l con t rol po i n t s 🠶 Po l y l i n e s a re con n e c t e d s e q u e n ce s of l i n e s
Areas 🠶 Areas are bounded by closed polylines or polygons 🠶 Areas can be filled with colour or a texture
Pixel 🠶 A p i x e l i s a po i n t of l i g h t . 🠶 I t i s j ust o n e ti n y do t on t h e r a s t e r d i s p l a y s . 🠶 Though it has no structure, it is definitely a building block and hence it can be con s i der e d a s t h e gr a p h i cs pr i m i t i v e . 🠶 The resolution of CRT is related to the dot size, the diameter of a single dot. 🠶 A resolution of 100 dots lines/inch implies a dot size of 0.01 inch. 🠶 However, in reality, pixels are more elliptic than circle. 🠶 The shape of a pixel purely depends upon the characteristics of the visual display unit.
Pixel.. 🠶
Line 🠶 Line, especially straight lines, constitute an important building block of computer images. 🠶 For example, line is the basic building block of Line graphs, bar and pie charts, two and three-dimensional graphs of mathematical functions, engineering drawings and architectural plans. 🠶 In computer graphics, straight line is so basic in creating images that we c a l l i t a g r a p h i cs pr i m i t i v e . 🠶 S t r a i g h t l i n e s c a n be d e v e l o pe d i n t w o d i ff e r e n t w a y s . 🠶 A structural method determines which pixels should be set before drawing the line; 🠶 a conditional method tests certain conditions to find which pixel should be s e t n e x t .
Polygon 🠶 A polygon, even though generally constructed from straight lines, is an i mport ant g rap h i cs pr i mi t i v e. 🠶 So often we want to handle polygon as a single entity, as images of objects from the real world consist in large part of polygons. 🠶 A polygon is a closed area of image bounded by straight or curved lines and f i ll ed w i t h one so l i d co l our . 🠶 Since images are two dimensional, a polygon is a closed planar figure. 🠶 Implementing a polygon as a graphics primitive is natural and helpful. 🠶 We can define polygon as an image which consists of a finite ordered set of s t ra i g ht bou ndar i es ca l l ed e d g es . 🠶 Alternately, the polygon can be defined by an ordered sequence of vertices , t he corners of t he po l ygon.
Polygon.. 🠶 The edges of the polygon are then obtained by traversing the vertices in the given order; 🠶 The edge list is sufficient for wireframe drawings. Two consecutive vertices define one edge. 🠶 We close the polygon by connecting the last vertex to the first. 🠶 F ac e l i s t i s r e q u i r e d i n ord e r t o f i l l t he po l y g on. 🠶 We can decompose a scene from real world into a collection of polygons of simple shapes. 🠶 For example, a simple house can be constructed with a square and a rectangle. 🠶 However, neither straight lines nor polygons precisely describe a real world scene; 🠶 It is only an approximation of the scene we can get; such scenes actually seem to be of frac t al na t ur e .
Polygon..
Graphics Pipeline 🠶 The graphics pipeline specifies a series of steps needed to display data on an output device. 🠶 The steps vary depending on the needs of the application. 🠶 T h e a p p l i c a ti on may be r e a l i s t i c, f a s t , a e s t h e ti c or i n for ma t i c. 🠶 However, the graphics Pipeline has three major components, viz. the application program which stores into and restores from the application data structure and sends graphics command to the graphics system .
Graphics Pipeline..
Graphics Pipeline.. 🠶 Application program : This is a collection of output plotting subroutines based on 2D or 3D geometry of the object to be displayed. 🠶 T h e a p p l i c a ti on pr o gr a m p e rf o rms t h e fo l l o w i n g: 🠶 View transforms : specifies what part of the world scene is to be displayed and converts those points into view coordinate points. 🠶 Converts from viewport to normailized device coordinates (NDC) : specifies w h e re i n t he v i e w s u rface s hou l d t he object b e di s p l a y e d. 🠶 Clips : Determine visible surfaces and shading. Then, the object outside the NDC i s c l i p p e d. 🠶 Maps data to device coordinates : All the geometric and non-geometric details in the data structure are converted to one of the graphics output primitives and passed to the graphics system i.e. the objects are scan converted into pixels and t he framebuf f e r di s p l a y e d.
Graphics Pipeline.. 🠶 Application data structure : This is a database of descriptions and properties, like geometric coordinates, colour, surface texture and connectivity relationships of objects to be displayed on the display unit of the graphics system. 🠶 For example, lets consider the design of a room with a few furniture in it. 🠶 T hen s t ruc t ure wou l d con t ai n 🠶 Description of primitives that defines the shape of the objects in the room. 🠶 Object attributes like line style, colour, texture that defines the “look” of the primitives 🠶 Connectivity relations and positioning data that defines how components fit together 🠶 Geometry spectrum that defines the layout of physical objects to description of concepts w i t hout geo m et ry ( eg . s t a t i s t i c s ) 🠶 Textual, numeric data (equations, formulas, etc.) and procedures often included in t he m ode l s
Graphics Pipeline..
Graphics Pipeline.. 🠶 Graphics syste m : T h i s h a n d l e s t h e l o w - l e v e l arch it e c t ure of t h e d i s p l a y processor and xy co-ordinate system of the physical screen, hiding these de t a i l s fr o m t h e us e r.
constants In computer graphics, a constant is a value that remains the same throughout the execution of a program and is represented by a meaningful name instead of a number or string. a graphic constant is a sequence of DBCS characters enclosed in single or double quotation marks . The syntax for graphic constant is “< Kk >” Like C# and Visual Basic, a constant can be explicitly declared as immutable he syntax for graphic constants is '< kk >'G
Actions In computer graphics, a variety of actions are performed to create, manipulate, and display images, animations, and 3D models. Here are some of the core actions : Rendering The process of generating a 2D image from a 3D model by simulating light interactions. Types include real-time rendering (used in gaming) and offline rendering (used in movies). Transformation Translation : Moving an object from one position to another. Rotation : Rotating an object around an axis. Scaling : Changing the size of an object in the x, y, or z direction. Shearing : Distorting an object along one axis
Projection Orthographic Projection : A projection where parallel lines remain parallel, typically used in CAD. Perspective Projection : A projection that simulates depth, used to mimic human vision in 3D rendering . Shading Adding color , light, and shadow to give objects a realistic appearance. Flat Shading : Applies a single color per polygon. Gouraud Shading : Smoothly interpolates colors across vertices. Phong Shading : Provides smoother and more realistic shading by interpolating normals across surfaces.
Culling Removing objects or faces that are not visible to the camera to save processing power. Back-face Culling : Hides surfaces that face away from the camera. Frustum Culling : Removes objects outside the camera's view Image Processing and Filtering Applying filters to manipulate image properties, like brightness, contrast, and blur. Techniques include Gaussian Blur , Sharpening , and Edge Detection . Alpha Blending Combining a foreground image with a background image using transparency. Used for effects like shadows, smoke, or translucent surfaces.
Geometric Transformation 2D Transformation In computer graphics, various transformation techniques are-
Clipping Cutting off parts of objects or scenes that are outside the view frustum (visible area), optimizing rendering. Clipping helps to reduce the number of calculations needed, improving performance . Rasterization Converting vector-based 3D models into a raster image (a grid of pixels) for display on screens. Involves filling in pixels within the boundaries of polygons. 10. Anti-Aliasing Reducing the visual "jaggedness" or "stair-step" appearance on edges by smoothing or blending pixels. Techniques include MSAA (Multi-Sample Anti-Aliasing) , SSAA (Super-Sample Anti-Aliasing) , and FXAA (Fast Approximate Anti-Aliasing) .