




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
computer graphics for MScIT
Typology: Study notes
1 / 194
This page cannot be seen from the preview
Don't miss anything!
UNIVERSITY OF MYSORE
Unit 1
Overview of Computer Graphics
Contents
Overview of Computer Graphics
1.0 Objectives 1.1 Introduction to Computer Graphics: Types of Computer Graphics 1.2 Applications of Computer Graphics 1.3 Techniques of Object Rendering: Shading, Ray Tracing, Reflection and Transparency 1.4 Graphics Software Packages: Two general classifications for graphics software 1.5 Graphical Input Devices 1.6 Graphical Output Devices 1.7 Polynomial Method for Ellipse and Circle 1.8 DDA Algorithm for Line, Circle and Ellipse 1.9 Bresenham's Algorithm for Line Drawing and Circle 1.10 Midpoint Methods for Line and Circle
1.0 Objectives
1.1 Introduction to Computer Graphics: Types of Computer Graphics Introduction to 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 number of pixels. Pixel is the smallest graphical picture or unit represented on the computer screen.
The term computer graphics includes almost everything on computers that is not text or sound. Today almost every computer can do some graphics, and people have even come to
of 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. Example: screen savers. 1.2 Applications of Computer Graphics
Design processes
A major use of computer graphics is in design processes, particularly for engineering and architectural systems, but almost all products are now computer designed. Generally referred to as CAD, computer-aided design methods are now routinely used in the design of buildings, automobiles, aircraft, watercraft, spacecraft, computers, textiles, and many, many other products Presentation graphics Another major application area is presentation graphics, used to produce illustrations for reports or to generate 35-mm slides or transparencies for use with projectors. Presentation graphics is commonly used to summarize financial, statistical, mathematical, scientific, and economic data for research reports, consumer information bulletins, and other types of reports. Workstation devices and service bureaus exist for converting screen displays into 35-mm slides or overhead transparencies for use in presentations. Typical examples of presentation graphics are bar charts, line graphs, surface graphs, pie charts, and other displays showing relationships between multiple parameters. Animations Animations are often used in CAD applications. Real-time animations using wise frame displays on a video monitor are useful for testing performance of a vehicle or system. Animations in virtual reality environments are used to determine how vehicle operators are affected by certain motions. When object designs are complete, or nearly complete, realistic lighting models and surface rendering are applied to produce displays that will show the appearance of the final product.
Laying out floor plans Architects use interactive graphics methods to lay out floor plans that show the positioning of rooms, doors, windows, stairs, shelves, counters, and other building features. Working from the display of a building layout on a video monitor, an electrical designer can try out arrangements for wiring, electrical outlets, and fire warning systems. Also, facility-layout packages can be applied to the layout to determine space utilization in an office or on a manufacturing floor. Realistic displays of architectural designs permit both architects and their clients to study the appearance of a single building or a group of buildings, such as a campus or industrial complex. With virtual-reality systems, designers can even go for a simulated "walk" through the rooms or around the outsides of buildings to better appreciate the overall effect of a particular design. In addition to realistic exterior building displays, architectural CAD packages also provide facilities for experimenting with three-dimensional interior layouts and lighting. Fine art and commercial art applications Computer graphics methods are widely used in both fine art and commercial art applications. Artists use a variety of computer methods, including special-purpose hardware, artist's paintbrush (such as Lumens), other paint packages (such as Pixelpaint and Superpaint), specially developed software, symbolic mathematics packages (such as Mathematics), CAD packages, desktop publishing software, and animation packages that provide facilities for designing object shapes and specifying object motions. The basic idea behind a paintbrush program is that it allows artists to "paint" pictures on the screen of a video monitor. Actually, the picture is usually painted electronically on a graphics tablet (digitizer) using a stylus, which can simulate different brush strokes, brush widths, and colors. Motion pictures, music videos, and television shows Computer graphics methods are now commonly used in making motion pictures, music videos, and television shows. Sometimes the graphics scenes are displayed by themselves, and sometimes graphics objects are combined with the actors and live scenes. Music videos use graphics in several ways. Graphics objects can be combined with the live action, or graphics and image processing techniques can be used to produce a transformation of one person or object into another (morphing).
also make extensive use of image processing techniques for picture enhancements, in tomography and in simulations of operations.
1.3 Techniques of Object Rendering We spend much of our time improving the way computer pictures can simulate real world scenes. We want images on computers to not just look more realistic, but also to be more realistic in their colors, the way objects and rooms are lighted, and the way different materials appear. We call this work "realistic image synthesis", and the following series of pictures will show some of the techniques in stages from very simple pictures through very realistic ones.
Object Rendering Rendering is the process of generating an image from a 2D or 3D model (or models in what collectively could be called a scene file), by means of computer programs. Also, the results of such a model can be called a rendering.
Computer graphics uses several simple object rendering techniques to make models appear three-dimensional. Shading Shading techniques extend the realistic appearance of objects and introduce features such as transparency and textures.
This vase has been modeled as a symmetrical pattern of vertically- oriented surfaces - tiny flat patches which approximate the round shape of the vase. In this image, each tiny surface is shaded separately with a different gray value based on its orientation to the light source.
By introducing a technique called Gouraud shading , we can smooth out the appearance of the vase and hide the individual surfaces from view. The shading is varied on each surface in proportion to values calculated at the edges and from neighboring surfaces.
Phong shading improves the apparent realism of the rendering still further by introducing highlights. The way light reflects from real surfaces depends on how shiny the surface is and on the angle you are looking from. Most surfaces are not shiny, but have a more dull or "matte" or "diffuse" appearance.
The best way to appreciate how far these simple techniques have been developed is through much more complex graphic images.
Radiosity
Radiosity is a method of rendering based on an detailed analysis of light reflections off diffuse surfaces. The images that result from a radiosity renderer are characterized by soft gradual shadows. Radiosity is typically used to render images of the interior of buildings, and can achieve extremely photo-realistic results for scenes that are comprised of diffuse reflecting surfaces.
Quality of Light
The research image sampler shows more current work in radiosity and other techniques.
1.4 Graphics Software Packages: Two general classifications for graphics software There are two general classifications for graphics software: General programming packages and Special-purpose applications packages.
Graphics Functions A general-purpose graphics package provides users with a variety of functions for creating and manipulating pictures. These routines can be categorized according to whether they deal with output, input, attributes, transformations, viewing, or general control. The basic building blocks for creating and manipulating pictures. These routines can be categorized according to whether they deal with output, input, attributes, transformations, viewing, or general control. The basic building blocks for pictures are referred to as output primitives. They include character strings and geometric entities, such as points, straight lines, curved Lines, filled areas (polygons, circles, etc.), and shapes defined with arrays of color points. Routines for generating output primitives provide the basic tools for conshucting pictures. Attributes are the properties of the output primitives; that is, an attribute describes how a particular primitive is to be displayed. They include intensity and color specifications, line styles, text styles, and area-filling patterns. Functions within this category can be used to set attributes for an individual primitive class or for groups of output primitives. We can change the size, position, or orientation of an object within a scene using geometric transformations. Similar modeling transformations are used to construct a scene using
positions by positioning the screen cursor. Other types of cursor-positioning devices, such as a trackball or joystick, are included on some keyboards. Additionally, a numeric keypad is, often included on the key-board for fast entry of numeric data.
Mouse- A mouse is small hand-held box used to position the screen cursor. Wheels or rollers on the bottom of the mouse can be used to record the amount and direction of movement. Another method for detecting mouse motion is with an optical sensor. For these systems, the mouse is moved over a special mouse pad that has a grid of horizontal and vertical lines. The optical sensor detects movement across the lines in the grid. Since a mouse can be picked up and put down at another position without in the position change in cursor movement, it is used for making relative change in the position of the screen cursor. One, two, or three buttons are usually included on the top of the mouse for signaling the execution of some operation, such as recording a cursor position or invoking a function. Most general-purpose graphics systems now include a mouse and a keyboard as the major input devices. Additional devices can be included in the basic mouse design to increase the number of allowable input parameters.
Trackball and Spaceball- As the name implies, a trackball is a ball that can be rotated with the fingers or palm of the hand to produce screen-cursor movement. Potentiometers, attached to the ball, measure the amount and direction of rotation. Trackballs are often mounted on keyboards or other devices such as the Z mouse. While a trackball is a two- dimensional positioning device, a spaceball provides six degrees of freedom. Unlike the trackball, a spaceball does not actually move. Strain gauges measure the amount of pressure applied to the spaceball to provide input for spatial positioning and orientation as the ball is pushed or pulled in various directions. Spaceballs are used for three-dimensional positioning and selection operations in virtual-reality systems, modeling, animation, CAD, and other applications.
Joysticks- A joystick consists of a small, vertical lever (called the stick) mounted on a base that is used to steer the screen cursor around. Most joysticks select screen positions with actual stick movement; others respond to pressure on the stick. Some joysticks are
mounted on a keyboard; others function as stand-alone units. The distance that the stick is moved in any direction from its center position corresponds to screen-cursor movement in that direction. Potentiometers mounted at the base of the joystick measure the amount of movement, and springs return the stick to the center position when it is released. One or more buttons can be programmed to act as input switches to signal certain actions once a screen position has been selected. In another type of movable joystick, the stick is used to activate switches that cause the screen cursor to move at a constant rate in the direction selected. Eight switches, arranged in a circle, are sometimes provided, so that the stick can select any one of eight directions for cursor movement. Pressure-sensitive joy-sticks, also called isometric joysticks, have a nonmovable stick. Pressure on the stick is measured with strain gauges and converted to movement of the cursor in the direction specified.
Data Glove- A data glove can be used to grasp a "virtual" object. The glove is constructed with a series of sensors that detect hand and finger motions. Electromagnetic coupling between transmitting antennas and receiving antennas is used to provide information about the position and orientation of the hand. The transmitting and receiving antennas can each be structured as a set of three mutually perpendicular coils, forming a three- dimensional Cartesian coordinate system. Input from the glove can be used to position or manipulate objects in a virtual scene. A two-dimensional projection of the scene can be viewed on a video monitor, or a three-dimensional projection can be viewed with a headset.
Digitizers- A common device for drawing, painting, or interactively selecting coordinate positions on an object is a digitizer. These devices can be used to input coordinate values in either a two-dimensional or a three-dimensional space. Typically, a digitizer is used to scan over a drawing or object and to input a set of discrete coordinate positions, which can be joined with straight-Iine segments to approximate the curve or surface shapes.
Light Pens- Pencil-shaped devices are used to select screen positions by detecting the light coming from points on the CRT screen. They are sensitive to the short burst of light emitted from the phosphorous coating at the instant the electron beam strikes a particular point. Other light sources, such as the background light in the room, are usually not detected by a light pen. An activated light pen, pointed at a spot on the screen as the electron beam lights up that spot, generates an electrical pulse that causes the coordinate position of the electron beam to be recorded. As with cursor-positioning devices, recorded Light-pen coordinates can be used to position an object or to select a processing option. Although Light pens are still with us, they are not as popular as they once were since they have several disadvantages compared to other input devices that have been developed. For
one, when a light pen is pointed at the screen, part of the main image is obscured by the hand and pen. And prolonged use of the light pen can cause arm fatigue. Also, light pens require special implementations for some applications because they cannot detect positions within black areas. To be able to select positions in any screen area with a light pen, we must have some non-zero intensity assigned to each screen pixel. In addition, light pens sometimes give false readings due to background lighting in a room.
Voice Systems- Speech recognizers are used in some graphics workstations as input devices to accept voice commands. The voice-system input can be used to initiate graphics operations or to enter data. These systems operate by matching an input to a predefined dictionary of words and phrases. A dictionary is set up for a particular operator by having, the operator speak the command words to be used into the system. Each word is spoken several times, and the system analyzes the word and establishes a frequency pattern for that word in the dictionary along with the corresponding function to be performed. Later, when a voice command is given, the system searches the dictionary for a frequency-pattern match. Voice input is typically spoken into a microphone mounted on a headset. The microphone is designed to minimize input of other background sounds. If a different operator is to use the system, the dictionary must be reestablished with that operator's voice patterns. Voice systems have some advantage over other input devices, since the attention of the operator does not have to be switched from one device to another to enter a command.
1.6 Graphical Output Devices Typically, the primary output device in a graphics system is a video monitor. The operation of most video monitors is based on the standard cathode-ray tube (CRT) design, but several other technologies exist and solid-state monitors may eventually predominate.
Refresh Cathode-Ray Tubes- A beam of electrons (cathode rays), emitted by an electron gun, passes through focusing and deflection systems that direct the beam toward specified positions on the p h o s p h o m t e d screen. The phosphor then emits a small spot of light at each position contacted by the electron beam. Because the light emitted by the phosphor