Docsity

Computer graphics and animation, Lecture notes of Computer Science

Partial preview of the text

Download Computer graphics and animation and more Lecture notes Computer Science in PDF only on Docsity!

FEDERAL UNIVERSITY DUTSIN-MA

FACULTY OF PHYSICAL SCIENCE

DEPARTMENT OF COMPUTER SCIENCE & IT

COURSE TITLE:

COMPUTER GRAPHICS AND ANIMATION

COURSE CODE:

CMP 461

First Semester, 2020/

COURSE SYLLABUS

1. Course Code and Title: CMP461 – Computer Graphic and Animation 2. Credit Units/Contact Hours: 3/ 3. Program: 400 Level Computer Science and IT 4. Course Lecturers: Muhammad Muntasir Yakubu and Ibrahim Rabi’u 5. Recommended Textbooks a. Jonas G., Luiz V., Mario C. S. (2018). Computer Graphics, Theory and Practice. b. Alexey B., Evgeniy S. (2013). Computer Graphics, from Pixels to Programmable Graphics Hardware c. Garth Gardner, (2002). Computer Graphics and Animation: History, Careers and Expert Advice d. Malay K. Pakhira, (2010). Computer Graphics, Multimedia and Animation e. Keith Osborn, (2015). Cartoon Character Animation with Maya 6. Specific Course Information The aim of this course is to provide an introduction to the theory and practice of computer graphics. By introducing topics that deal with computer graphics rendering of primitive objects, polygon clipping algorithms, two-dimensional transformations, three- dimensional transformations, viewing camera rendering and projections, object representations, three-dimensional curve and surface were rendering algorithms, and line and surface removal algorithms. 7. Specific Goals for the Course In order to achieve the laid down goals, the course has a set of objectives. Each unit is designed with specific objectives at the beginning. The students are advised to read these objectives very carefully before embarking on the study unit. You may also wish to refer to them during your study in order to measure your progress. You are also advised to look at the unit objectives after completion of each unit. By so doing, you would have followed the instruction of the unit. Below are the comprehensive listings of the overall objective s of the course. By meeting these objectives, the said aims of the course must have been achieved. Thus the after going through this course you should be able to:

INTRODUCTION OF COMPUTER GRAPHICS

It is difficult to display an image of any size on the computer screen. This method is simplified by using Computer graphics. Graphics on the computer are produced by using various algorithms and techniques. This tutorial describes how a rich visual experience is provided to the user by explaining how all these processed by the computer. Computer Graphics involves technology to access. The Process transforms and presents information in a visual form. In today life, computer graphics has now become a common element in user interfaces, T.V. commercial motion pictures. Computer Graphics is the creation of pictures with the help of a computer. The end product of the computer graphics is a picture it may be a business graph, drawing, and engineering. In computer graphics, two or three-dimensional pictures can be created that are used for research. Many hardware devices algorithm has been developing for improving the speed of picture generation with the passes of time. It includes the creation storage of models and image of objects. These models for various fields like engineering, mathematical and so on. Today computer graphics is entirely different from the earlier one. It is not possible. It is an interactive user can control the structure of an object of various input devices. Definition of Computer Graphics: It is the use of computers to create and manipulate pictures on a display device. It comprises of software techniques to create, store, modify, represents pictures. Why computer graphics used? Suppose a shoe manufacturing company want to show the sale of shoes for five years. For this vast amount of information is to store. So a lot of time and memory will be needed. This method will be tough to understand by a common man. In this situation graphics is a better alternative. Graphics tools are charts and graphs. Using graphs, data can be represented in pictorial form. A picture can be understood easily just with a single look. Interactive computer graphics work using the concept of two-way communication between computer users. The computer will receive signals from the input device, and the picture is modified accordingly. Picture will be changed quickly when we apply command.

Application of Computer Graphics

1. Education and Training: Computer-generated model of the physical, financial and economic system is often used as educational aids. Model of physical systems, physiological system, population trends or equipment can help trainees to understand the operation of the system. For some training applications, particular systems are designed. For example Flight Simulator. Flight Simulator: It helps in giving training to the pilots of airplanes. These pilots spend much of their training not in a real aircraft but on the ground at the controls of a Flight Simulator. Advantages: 1. Fuel Saving 2. Safety 3. Ability to familiarize the training with a large number of the world's airports. 2. Use in Biology: Molecular biologist can display a picture of molecules and gain insight into their structure with the help of computer graphics. 3. Computer-Generated Maps: Town planners and transportation engineers can use computer- generated maps which display data useful to them in their planning work. 4. Architect: Architect can explore an alternative solution to design problems at an interactive graphics terminal. In this way, they can test many more solutions that would not be possible without the computer. 5. Presentation Graphics: Example of presentation Graphics are bar charts, line graphs, pie charts and other displays showing relationships between multiple parameters. Presentation Graphics is commonly used to summarize o Financial Reports o Statistical Reports o Mathematical Reports o Scientific Reports o Economic Data for research reports o Managerial Reports o Consumer Information Bulletins o And other types of reports 6. Computer Art: Computer Graphics are also used in the field of commercial arts. It is used to generate television and advertising commercial.

Advantages:

  1. Higher Quality
  2. More precise results or products
  3. Greater Productivity
  4. Lower analysis and design cost
  5. Significantly enhances our ability to understand data and to perceive trends. Working of Interactive Computer Graphics: The modern graphics display is very simple in construction. It consists of three components:
  6. Frame Buffer or Digital Memory
  7. A Monitor likes a home T.V. set without the tuning and receiving electronics.
  8. Display Controller or Video Controller: It passes the contents of the frame buffer to the monitor. Frame Buffer: A digital frame buffer is large, contiguous piece of computer memory used to hold or map the image displayed on the screen. o At a minimum, there is 1 memory bit for each pixel in the raster. This amount of memory is called a bit plane. o A 1024 x 1024 element requires 2^20 (2^10 =1024;2^20 =1024 x 1024)sq.raster or 1,048, memory bits in a single bit plane. o The picture is built up in the frame buffer one bit at a time. o ∵ A memory bit has only two states (binary 0 or 1), a single bit plane yields a black and white (monochrome display). o As frame buffer is a digital device write raster CRT is an analog device.

Properties of Video Monitor:

1. Persistence: Persistence is the duration of phosphorescence. Different kinds of phosphors are available for use in CRT. Besides color, a major difference between phosphor in their persistence how they continue to emit light after the electron beam is removed. 2. Resolution: Use to describe the number of pixels that are used on display image. 3. Aspect Ratio: It is the ratio of width to its height. Its measure is unit in length or number of pixels. Aspect Ratio = Graphics Systems Display Processor: It is interpreter or piece of hardware that converts display processor code into pictures. It is one of the four main parts of the display processor Parts of Display Processor 1. Display File Memory 2. Display Processor 3. Display Generator 4. Display Console Display File Memory: It is used for generation of the picture. It is used for identification of graphic entities.

At the start of a Refresh Cycle : X register is set to 0 and y register is set to ymax. This (x, y') address is translated into a memory address of frame buffer where the color value for this pixel position is stored. The controller receives this color value (a binary no) from the frame buffer, breaks it up into three parts and sends each element to a separate Digital-to-Analog Converter (DAC). These voltages, in turn, controls the intensity of 3 e-beam that are focused at the (x, y) screen position by the horizontal and vertical drive signals. This process is repeated for each pixel along the top scan line, each time incrementing the X register by Y. As pixels on the first scan line are generated, the X register is incremented throughxmax. Then x register is reset to 0, and y register is decremented by 1 to access the next scan line. Pixel along each scan line is then processed, and the procedure is repeated for each successive scan line units pixels on the last scan line (y=0) are generated. For a display system employing a color look-up table frame buffer value is not directly used to control the CRT beam intensity. It is used as an index to find the three pixel-color value from the look-up table. This lookup operation is done for each pixel on every display cycle. As the time available to display or refresh a single pixel in the screen is too less, accessing the frame buffer every time for reading each pixel intensity value would consume more time what is allowed:

Multiple adjacent pixel values are fetched to the frame buffer in single access and stored in the register. After every allowable time gap, the one-pixel value is shifted out from the register to control the warm intensity for that pixel. The procedure is repeated with the next block of pixels, and so on, thus the whole group of pixels will be processed. Display Devices: The most commonly used display device is a video monitor. The operation of most video monitors based on CRT (Cathode Ray Tube). The following display devices are used:

  1. Refresh Cathode Ray Tube
  2. Random Scan and Raster Scan
  3. Color CRT Monitors
  4. Direct View Storage Tubes
  5. Flat Panel Display
  6. Lookup Table Cathode Ray Tube (CRT): CRT stands for Cathode Ray Tube. CRT is a technology used in traditional computer monitors and televisions. The image on CRT display is created by firing electrons from the back of the tube of phosphorus located towards the front of the screen. Once the electron heats the phosphorus, they light up, and they are projected on a screen. The color you view on the screen is produced by a blend of red, blue and green light.

cycles back to the first line and design all the lines of the image 30 to 60 time each second. The process is shown in fig: Random-scan monitors are also known as vector displays or stroke-writing displays or calligraphic displays. Advantages:

  1. A CRT has the electron beam directed only to the parts of the screen where an image is to be drawn.
  2. Produce smooth line drawings.
  3. High Resolution Disadvantages:
  4. Random-Scan monitors cannot display realistic shades scenes. Raster Scan Display: A Raster Scan Display is based on intensity control of pixels in the form of a rectangular box called Raster on the screen. Information of on and off pixels is stored in refresh buffer or Frame buffer. Televisions in our house are based on Raster Scan Method. The raster scan system can store information of each pixel position, so it is suitable for realistic display of objects. Raster Scan provides a refresh rate of 60 to 80 frames per second. Frame Buffer is also known as Raster or bit map. In Frame Buffer the positions are called picture elements or pixels. Beam refreshing is of two types. First is horizontal retracing and second is vertical retracing. When the beam starts from the top left corner and reaches the bottom right

scale, it will again return to the top left side called at vertical retrace. Then it will again more horizontally from top to bottom call as horizontal retracing shown in fig: Types of Scanning or travelling of beam in Raster Scan

  1. Interlaced Scanning
  2. Non-Interlaced Scanning In Interlaced scanning, each horizontal line of the screen is traced from top to bottom. Due to which fading of display of object may occur. This problem can be solved by Non-Interlaced scanning. In this first of all odd numbered lines are traced or visited by an electron beam, then in the next circle, even number of lines are located. For non-interlaced display refresh rate of 30 frames per second used. But it gives flickers. For interlaced display refresh rate of 60 frames per second is used. Advantages:
  3. Realistic image
  4. Million Different colors to be generated
  5. Shadow Scenes are possible. Disadvantages:
  6. Low Resolution
  7. Expensive Differentiate between Random and Raster Scan Display: Random Scan Raster Scan

Advantages:

  1. Inexpensive Disadvantages:
  2. Only four colors are possible
  3. Quality of pictures is not as good as with another method.
  4. Shadow-Mask Method: o Shadow Mask Method is commonly used in Raster-Scan System because they produce a much wider range of colors than the beam-penetration method. o It is used in the majority of color TV sets and monitors. Construction: A shadow mask CRT has 3 phosphor color dots at each pixel position. o One phosphor dot emits: red light o Another emits: green light o Third emits: blue light This type of CRT has 3 electron guns, one for each color dot and a shadow mask grid just behind the phosphor coated screen. Shadow mask grid is pierced with small round holes in a triangular pattern. Figure shows the delta-delta shadow mask method commonly used in color CRT system.

Working: Triad arrangement of red, green, and blue guns. The deflection system of the CRT operates on all 3 electron beams simultaneously; the 3 electron beams are deflected and focused as a group onto the shadow mask, which contains a sequence of holes aligned with the phosphor- dot patterns. When the three beams pass through a hole in the shadow mask, they activate a dotted triangle, which occurs as a small color spot on the screen.

Function of guns: Two guns are used in DVST

  1. Primary guns: It is used to store the picture pattern.
  2. Flood gun or Secondary gun: It is used to maintain picture display. Advantage:
  3. No refreshing is needed.
  4. High Resolution
  5. Cost is very less Disadvantage:
  6. It is not possible to erase the selected part of a picture.
  7. It is not suitable for dynamic graphics applications.
  8. If a part of picture is to modify, then time is consumed. Flat Panel Display: The Flat-Panel display refers to a class of video devices that have reduced volume, weight and power requirement compare to CRT.

Example: Small T.V. monitor, calculator, pocket video games, laptop computers, an advertisement board in elevator.

1. Emissive Display: The emissive displays are devices that convert electrical energy into light. Examples are Plasma Panel, thin film electroluminescent display and LED (Light Emitting Diodes). 2. Non-Emissive Display: The Non-Emissive displays use optical effects to convert sunlight or light from some other source into graphics patterns. Examples are LCD (Liquid Crystal Device). Plasma Panel Display: Plasma-Panels are also called as Gas-Discharge Display. It consists of an array of small lights. Lights are fluorescent in nature. The essential components of the plasma-panel display are: 1. Cathode: It consists of fine wires. It delivers negative voltage to gas cells. The voltage is released along with the negative axis. 2. Anode: It also consists of line wires. It delivers positive voltage. The voltage is supplied along positive axis. 3. Fluorescent cells: It consists of small pockets of gas liquids when the voltage is applied to this liquid (neon gas) it emits light. 4. Glass Plates: These plates act as capacitors. The voltage will be applied, the cell will glow continuously. The gas will slow when there is a significant voltage difference between horizontal and vertical wires. The voltage level is kept between 90 volts to 120 volts. Plasma level does not require refreshing. Erasing is done by reducing the voltage to 90 volts. Each cell of plasma has two states, so cell is said to be stable. Displayable point in plasma panel is made by the crossing of the horizontal and vertical grid. The resolution of the plasma panel can be up to 512 * 512 pixels. Figure shows the state of cell in plasma panel display: