In this tutorial, you will learn the basics of computer graphics. To begin with, you should know why one should study computer graphics. Its areas of application include the design of objects, animation, simulation etc.
The concept of computer graphics simply means identifying their areas of the screen that is to be illuminated and those that should not be. Most of the regular figures like straight lines, circles etc, are represented by mathematical equations. Given such equations, the first aspect of computer graphics is to convert them to a sequence of points – picture cells or pixels or simply convert it to a curve that should be traced on the screen.
What is Computer Graphics?
Computer graphics is an art of drawing pictures, lines, charts, etc using computers with the help of programming. Computer graphics is made up of a number of pixels. Pixel is the smallest graphical picture or unit represented on the computer screen. Basically, there are two types of computer graphics namely –
1) Interactive computer graphics
It is the computer graphics in which a user can interact with the image on the computer screen. Here exist two-way communication between the user and the image. The image is totally under the control of the user. For example, Playing a game on the computer. Here user controls the image completely. According to the user, wish image makes the movements on the screen.
2) Non-interactive computer graphics
It is the computer graphics in which a user does not have any kind of control over the image. The image is merely the product of the static stored program and will work according to the instructions given in the program linearly. The image is totally under the control of program instructions not under the user. for example, screensavers.
Areas of computer graphics
Computer graphics is useful in almost all part of our life. In the following sections, we are discussing some of the popular areas of computer graphics.
1. Design and Drawing
In almost all areas of engineering, be it civil, mechanical, electronic etc., drawings are of prime importance. In fact, drawing is said to be the language of engineers. The ability of computers to store complex drawings and display them on demand was one of the major attractions for using computers in graphics mode.
Making the pictures to move on the graphical screen is called animation. The animation really makes the use of computers and computer graphics interesting.
Animation also plays a very important role in training through computer graphics. If you have been given a bicycle you might have learned to ride it easily with little effort, but if you have been given a flight, automatically it needs the animated images to study the entire scenario of how flight takes off, on and handling it during flying, contacting with and getting the help from control room etc will be better explained using computers animation technique.
3. Multimedia applications
The use of sound cards to make computers produce sound effect led to other uses of graphics. The concept of virtual reality, wherein one can be taken through an unreal experience, like going through an unbuilt house (to see how it feels inside, once it is built) is possible by the use of computer graphics technology.
The other revolutionary change that graphics made was in the area of simulation. Basically, simulation is a mockup of an environment elsewhere to study or experience it. One example is of flight simulators.
How are pictures actually stored and displayed?
All operations on computers are in terms of 0’s and 1’s and hence figures are also to be stored in terms of 0’s and 1’s. Thus a picture file, when viewed inside the memory, can be no different from other files – a string of Os and 1s. However, their treatment when they are to be displayed makes the difference.
Pictures are actually formed with the help of frame-buffer display.
Frame buffer display contains a frame buffer, which is a storage device and stores the image in terms of 0’s and 1’s. It contains the 0’s and 1’s in terms of 8’s or multiples of 8’s in a row. These 0’s and 1’s will be read by display controller one line at a time and sent to the screen after converting them from digital to analog.
The display controller reads the contents of frame buffer one line at a time or entire digits at a time. The following figure illustrates this –
Figures can be stored and drawn in two ways – either by line drawing or by Raster graphics methods.
1. Line Drawing Mechanism
In the line drawing scheme, the figures are represented by equations – for example, a straight line can be represented by the equation y=mx+c, a circle by x2+y2=r2 etc.
If (x, y) are representative points, then all these (x,y) value pairs which satisfy the equations form a part of the figure while those that do not, lie outside the figure. Thus, to generate any figure, obviously, the equation of the figure is to be known. Then all points that satisfy the equation are evaluated. These are the points to be illuminated on the screen.
A moving electronic beam, on the screen or the monitor. Whenever the beam is switched on, the electrons illuminate the phosphorescent screen and display a point.
In the line drawing schemes, this beam is made to traverse the path of the figure to be traced and we get the figure we need.
For example, in the above-cited example, if the electron beam is made to move from a to be along the points, we get the line.
2. Raster Scan Mechanism
The raster scan mechanism uses a different technique and it is often found more convenient to manipulate and operate with.
In this case, a “frame buffer”, (a chunk of memory) is made to store the pixel values. Remember, the screen can be thought of as having beam made up of a number of horizontal rows of pixels (picture cells), each pixel representing a point on the picture.
Each screen point is referred to as a pixel (picture element) or pel. At the end of each scan line, the electron beam returns to the left side of the screen to begin displaying the next scan line.
The number of such horizontal and vertical points indicate higher resolutions and therefore better pictures. Typical resolutions are like 640 x 480, 860 x 640, 1024 x 860 etc., where the figures indicate the number of rows and the number of pixels along each row respectively on a computer screen (unlike in standard mathematics) the top left hand point indicates the origin or the point (0,0) and the distances are measured horizontally and vertically as shown).
Now, assuming a 1024 x 1024 point screen, any figure that is to be displayed within this space. The “frame buffer” stores “status” of each of these pixels – say
0 indicates the pixel is off and hence is not a part of the picture and 1 indicates it is a part of the picture and is to be displayed. This data is used to display the pictures.
What happens when the size of the picture exceeds the size of the screen?
Some areas of the picture are to be cut off. But this involves certain considerations and needs to be addressed by software.
Can the user create pictures directly on the screen?
Definitely, all pictures cannot be thought of in terms of regular geometric figures and hence in terms of equations? Now, seeing a particular picture on the screen, the viewer wants to change it slightly, say bend it slightly here, stretch it their etc.
Application of Computer Graphics
Computer Graphics has numerous applications, some of which are listed below −
- Computer graphics user interfaces (GUIs) − A graphic, mouse-oriented paradigm which allows the user to interact with a computer.
- Business presentation graphics − “A picture is worth a thousand words”.
- Cartography − Drawing maps.
- Weather Maps − Real-time mapping, symbolic representations.
- Satellite Imaging − Geodesic images.
- Photo Enhancement − Sharpening blurred photos.
- Medical imaging − MRIs, CAT scans, etc. – Non-invasive internal examination.
- Engineering drawings − mechanical, electrical, civil, etc. – Replacing the blueprints of the past.
- Typography − The use of character images in publishing – replacing the hard type of the past.
- Architecture − Construction plans, exterior sketches – replacing the blueprints and hand drawings of the past.
- Art − Computers provide a new medium for artists.
- Training − Flight simulators, computer-aided instruction, etc.
- Entertainment − Movies and games.
- Simulation and modeling − Replacing physical modeling and enactments