Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Chapter 01

1.1. Image and object:-


There’s a very basic distinction in the kinds of pictures (and therefore kinds of graphics) we use with computers. The difference
is really simple, but very difficult to describe precisely.In the old days, they referred to the two types as “raster” and “vector”.
We prefer “image-based” and “object-based”.

​The definitions:

● An ​image-based (or raster) graphic represents the pictures by measuring the color at a predetermined set of
locations (usually a grid).
● For example,Think of a picture taken with a camera: it tells you a color for each point taken on a fixed grid.
● An ​object-based (or vector) graphic represents the picture by describing the objects in the picture in a
mathematical way.
● For example, list the 2D things (lines, circles). The number and positions of these objects can vary.

Chapter 01 Compiled Dashrath Kale Computer Graphics


Sr.no Image-based Object-based

1 Image-based often called Raster image Object-based often called Vector image

2 This represent scene using Pixel This represent scene using mathematical way

3 This resolution Dependant This not dependant on Resolution

4 This is poor at scaling This is good at scaling

5 Good for presenting realistic scene This is good for presenting large areas of constant
color.

6 Modification is difficult Modification is easy

7 E.g. JPEG,GIF,TIFF,PNG E.g.SVG,PDF,CDR,AI,EPS

Pixel:-
1.In Computer graphics pixels, dots, or picture element is a physical point in a
picture.

2.A pixel is the smallest addressable element of a picture represented on a


screen.

3.A majority of the pictures that we see on our computer screen are raster
images.

4.The selfie that you click with your mobile phone is another example of a
raster image.

5.An image is made up using a collection of pixels referred to as a bitmap.

6.we define a pixel as the smallest element of an image.

7.We also defined that a pixel can store a value proportional to the light intensity at that particular location.

8. For example,

1 bpp, 21 = 2 colors (monochrome)

2 bpp, 22 = 4 colors

3 bpp, 23 = 8 colors

8 bpp, 28 = 256 colors

16 bpp, 216 = 65,536 colors ("Highcolor" )

Chapter 01 Compiled Dashrath Kale Computer Graphics


24 bpp, 224 = 16,777,216 colors ("Truecolor")

Resolution

1.The resolution can be defined in many ways. Such as pixel resolution,


spatial resolution, temporal resolution, spectral resolution. Out of which we
are going to discuss pixel resolution.
2.You have probably seen that in your own computer settings, you have a
monitor resolution of 800 x 600, 640 x 480 e.t.c
3.In pixel resolution, the term resolution refers to the total number of counts
of pixels in a digital image. For example, If an image has M rows and N
columns, then its resolution can be defined as M X N.
4.If we define resolution as the total number of pixels, then pixel resolution
can be defined with a set of two numbers. The first number is the width of
the picture, or the pixels across columns, and the second number is the
height of the picture, or the pixels across its width.
5.We can say that the higher the pixel resolution, the higher is the quality of the image.
6.We can define pixel resolution of an image as 1366 X 780.
7.For example,

If an image has M rows and N columns, then its resolution can be defined as M X N.
VGA : 1640 x 480
SVGA : 800 x 600
XGA : 1024 x 768
SXGA : 1400 x 1050
​HD​+: 1600 x 900
​FHD​: ​1920 x 1080

Text mode:-

● it is the kind of mode, where the entire screen is represented


by a 2D character array (usually 80x25). Depending on what is present in
that array, the corresponding ASCII letter was displayed on the screen.
● For example,​65-A,97-a.

Application:
1.command-line interfaces (terminal)
2.text user interfaces(Turbo c++)

Graphics mode:​-

● it had a different 2D buffer with much bigger dimensions


(usually 640x480), where you can control the color of each and every
element in that 2D buffer​.
​E.g Graphical Output
Application:1.GUI 2.Corel Draw

Chapter 01 Compiled Dashrath Kale Computer Graphics


Sr. Text Mode Graphics Mode
No

1 When you start a program under MS-DOS, the While when you start a program under windows, the
computer's screen is in character mode computer's screen is in graphics mode.

2 In character mode, every character is drawn as a Whereas in graphic mode, everything is drawn one dot (pixel)
dot pattern at a time

3 In character mode, the usual display configuration Whereas a typical VGA display will show 640 pixels horizontally
allows 80 characters across each row and 25 lines and 480 pixels vertically.
of characters.

4 The characters always have the same font, although Whereas in graphic mode, each pixel can be any of 16 colors
the color of each letter and its background can be
changed.

5 The Characters mode displays are relatively faster. It's Slower as compared to text mode.

6 In character mode, there is no way to show pictures whereas in graphics mode we can display pictures, charts,
graphs very easily

Graphics Pipeline 
● Graphics Pipeline is the sequence of steps that OpenGL takes when rendering objects. Vertex attribute and other
data go through a sequence of steps to generate the final image on the screen.
● It is a conceptual model that describes what steps a graphics system needs to perform to render a 3D scene to a 2D
screen.
● Once a 3D model has been created, for instance in a video game or any other 3D computer animation, the graphics
pipeline is the process of turning that 3D model into what the computer displays.
● The model of the graphics pipeline is usually used in real-time rendering.
● Often, most of the pipeline steps are implemented in hardware, which allows for special optimizations.  
 

Working:​-


Vertex Processing: Process and transform individual vertices & normals.

Rasterization: Convert each primitive (connected vertices) into a set of fragments. A fragment can be interpreted as a
pixel with attributes such as position, color, normal and texture.
● Fragment Processing: Process individual fragments.
● Output Merging: Combine the fragments of all primitives (in 3D space) into 2D color-pixel for the display.
Advantage:-
● The process of each primitive (Which is a set of vertices) can be done independently.
● Graphics Pipeline leads fast performance.
Disadvantage:
● Graphics like shadowing,reflection,blending cannot be handled in a physically correct manner.

Chapter 01 Compiled Dashrath Kale Computer Graphics


1.Bitmap Image:-

1.(BMP) is an image file format that can be used to create and store computer
graphics.
2. A bitmap file displays small dots in a pattern that, when viewed from afar,
creates an overall image.
3.A bitmap image is a grid made of rows and columns where a specific cell is
given a value that fills it in or leaves it blank.
4. an image is broken into the smallest possible units (pixels) and then the color
information of each pixel (color depth) is stored in bits that are mapped out in
rows and columns.
5.The complexity of a bitmap image can be increased by varying the color
intensity of each dot or by increasing the number of rows and columns used to
create the image.
6.However, when a user magnifies a bitmap image enough, it eventually becomes pixelated as the dots resolve into
tiny squares of color on a grid.
2.Application of Concept/ Examples in real life​:
1.Bitmap Image:-
1.JPEG,PNG,TIFF,GIF.
2.Graphical user interface.
3.Bitmap Image:
Advantage:
● Larger in size than vector based.
● More suitable for complex image
Disadvantage:
● More difficult to convert bitmap to vector graphics.
● Bitmap graphics are affected by resolution.

2.Vector Image:-

1.It is a type of image.Vector images are graphical representations of


mathematical objects such as lines, curves, polygons and it's like.
2.These graphics are generated by computer and they follow x and y axis as
their reference definition.
3.One characteristic of vector graphics is a very high resolution.
4.Such images can be altered easily and their resolution per square pixel
remains intact at any level.
5.Common image formats like GIFs and JPEGs are the opposite; these bitmap
images are pixel-based and so can't be resized without losing quality.
6.Once a vector image is rasterized to a .gif or .jpeg, they lose their original
resolution.
7.The Scalable Vector Graphics (SVG) format is the W3C standard for vector graphics.
2.Vector Image:-
1.list the 2D things (lines, circles,polygon).
2.AI,SVG.PDF,CDR.
3.​vector Graphics :
Advantage:-
● Does not affect by resolution.
● Modification in vector graphics is easy
Disadvantage:
● Not appropriate for complex images
● Smaller in size than bitmap based

Sr.no Bitmap Graphics Vector Based graphics

1 Pixel are used to form bitmap image Mathematical formula are used to form vector
based image

2. Larger in size than vector based Smaller in size than bitmap based

Chapter 01 Compiled Dashrath Kale Computer Graphics


3. Bitmap graphics are affected by resolution Does not affect by resolution.

4. Modification in bitmap image is more difficult Modification in vector graphics is easy

5. More suitable for complex image Not appropriate for complex images

Application of Computer Graphics:-


1.Computer graphics user interfaces (GUIs) − A graphic, mouse-oriented paradigm which allows the user to interact
with a computer.
2.Business presentation graphics − "A picture is worth a thousand words".
3.Cartography − Drawing maps.
4.Weather Maps − Real-time mapping, symbolic representations.
5.Satellite Imaging − Geodesic images.
6.Simulation and modeling − Replacing physical modeling and enactments.
7.Photo Enhancement − Sharpening blurred photos.
8.Medical imaging − MRIs, CAT scans, etc. - Non-invasive internal examination.
9.Engineering drawings − mechanical, electrical, civil, etc. - Replacing the blueprints of the past.
10.Typography − The use of character images in publishing - replacing the hard type of the past.
11.Architecture − Construction plans, exterior sketches - replacing the blueprints and hand drawings of the past.
12.Art − Computers provide a new medium for artists.
13.Training − Flight simulators, computer aided instruction, etc.
14.Entertainment − Movies and games.

Chapter 01 Compiled Dashrath Kale Computer Graphics


​1.CRT:-

The primary output device in a graphical system is the video monitor.


The main element of a video monitor is the
Cathode Ray Tube (CRT), shown in the
following illustration.
The operation of CRT is very simple −
● Electron Gun: The electron
gun is made up of several elements, mainly a
heating filament (heater) and a cathode.The
electron gun is a source of electrons focused
on a narrow beam facing the CRT.
● Focusing & Accelerating
Anodes: These anodes are used to produce a
narrow and sharply focused beam of electrons.
● Horizontal & Vertical
Deflection Plates: These plates are used to
guide the path of the electron in the beam. The plates produce an electromagnetic field that bends the
electron beam through the area as it travels.
● Phosphor-coated Screen: The phosphor coated screen is used to produce bright spots when the
high-velocity electron beam hits it.

Application of Concept/ Examples in real life​:


CRT :
1.In Television.
2.As display device for radar system
3. Oscilloscope.
4.Computer monitor.
CRT Advantage:
1. They operate at any resolution, geometry and aspect ratio without the need for rescaling the image.
2. CRTs run at the highest pixel resolutions generally available.
3. Produce a very dark black and the highest contrast levels normally available.
4. CRTs are less expensive than comparable displays using other display technologies.
CRT Disadvantage:
1. Sharpness is not like other Display devices..
2. Subject to geometric distortion and screen regulation problems.
3. Affected by magnetic fields from other equipment including other CRTs.
4. Relatively bright but not as bright as LCDs.
5. They are large, heavy, and bulky. They consume a lot of electricity and produce a lot of heat.

There are two ways (Random scan and Raster scan) by which we can display an object on the screen

1.Raster Scan:-
1.In a raster scan system, the electron beam is swept across the screen, one row at a time from top to bottom.
2.As the electron beam moves across each row, the beam intensity is turned on and off to create a pattern of
illuminated spots.
3.Picture definition is stored in a memory area called the Refresh Buffer or
Frame Buffer.
4.This memory area holds the set of intensity values for all the screen points.
5.Stored intensity values are then retrieved from the refresh buffer and
“painted” on the screen one row (scan line) at a time as shown in the following
illustration.
6.Each screen point is referred to as a pixel (picture element) or pel.
7.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.

Types of Scanning or travelling of beam in Raster Scan


1.Interlaced Scanning

Chapter 01 Compiled Dashrath Kale Computer Graphics


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.
2.Random Scan (Vector Scan)
1.In this technique, the electron beam is directed only to the
part of the screen where the picture is to be drawn rather than
scanning from left to right and top to bottom as in raster scan.
2.It is also called vector display, stroke-writing display, or
calligraphic display.
3.Picture definition is stored as a set of line-drawing
commands in an area of memory referred to as the refresh
display file.
4.To display a specified picture, the system cycles through the
set of commands in the display file, drawing each component
line in turn.
5.After all the line-drawing commands are processed, the
system cycles back to the first line command in the list.
6.Random-scan displays are designed to draw all the component lines of a picture 30 to 60 Frame times each second.
2.Raster Scan :
Advantage:
● Realistic image
● Million Different colors to be generated
● Shadow Scenes are possible.
Disadvantages:
● Low Resolution
● Expensive

3.Random Scan:-
Advantages:
● A CRT has the electron beam directed only to the parts of the screen where an image is to be drawn.
● Produce smooth line drawings.
● High Resolution
Disadvantages:
● Random-Scan monitors cannot display realistic shades scenes.

2.Flat Panel Display:


The Flat-Panel display refers to a class of video devices that have reduced volume, weight and power requirements
compared to CRT.Example: Small T.V. monitor, calculator, pocket video games, laptop computers, an advertisement
board in elevato
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).
1.Plasma Panel Display:
1.Plasma-Panels are also called Gas-Discharge Display.
2.It consists of an array of small lights. Lights are
fluorescent in nature.
3.The essential components of the plasma-panel display
are:
● Cathode: It consists of fine wires. It
delivers negative voltage to gas cells. The voltage is
released along with the negative axis.

Chapter 01 Compiled Dashrath Kale Computer Graphics


● Anode: It also consists of line wires. It delivers positive voltage. The voltage is supplied along the positive
axis.
● Fluorescent cells: It consists of small pockets of gas liquids when the voltage is applied to this liquid (neon
gas) it emits light.
● Glass Plates: These plates act as capacitors. The voltage will be applied, the cell will glow continuously.
4.The gas will slow when there is a significant voltage difference between horizontal and vertical wires.
5.The voltage level is kept between 90 volts to 120 volts. Plasma level does not require refreshing.
6.Erasing is done by reducing the voltage to 90 volts.Each cell of plasma has two states, so the cell is said to be stable.
7.Displayable point in plasma panel is made by the crossing of the horizontal and vertical grid.

​ 920×1080 .
8.The resolution of the plasma panel can be up to 512 * 512 pixels now latest ​ 1

Plasma panel:
Advantage:
● High Resolution
● Large screen size is also possible.
● Less Volume
● Less weight
● Flicker Free Display
Disadvantage:
● Poor Resolution
● Wiring requirement anode and the cathode is complex.
● Its addressing is also complex.

2 LED (Light Emitting Diode):


1.In an LED, a matrix of diodes is organized to form the
pixel positions in the display and picture definition is
stored in a refresh buffer.
2.Data is read from the refresh buffer and converted to
voltage levels that are applied to the diodes to produce
the light pattern in the display.

2.Application:-
1. ​digital billboards​,Bus no,Railway platform,highway etc.
2.​Decorate interiors and exteriors.
3.Advertise brands and products.

Advantages:-
● Longevity
● They light up faster
● Cost Effectiveness
● Durability
● Color
● Eco-friendly
Disadvantage
● High initial cost
● Temperature Sensitive
● Voltage Sensitive
● Eye Strain

Chapter 01 Compiled Dashrath Kale Computer Graphics


3.LCD (Liquid Crystal Display):-
1.Liquid Crystal Displays are the devices that produce a picture by passing polarized light from the surroundings or
from an internal light source through a liquid-crystal
material that transmits the light.
2.LCD uses the liquid-crystal material between two
glass plates; each plate is the right angle to each
other between plates.
3.One glass plate consists of a column of conductors
arranged in a vertical direction.
4.Another glass plate consists of a row of
conductors arranged in horizontal direction.
5.The pixel position is determined by the intersection of the vertical & horizontal conductor.
6.This position is an active part of the screen.Liquid crystal display is temperature dependent.
7.It is between zero to seventy degree Celsius. It is flat and requires very little power to operate.
Application:-
1. The liquid crystal displays (LCDs) are used in aircraft cockpit displays
2. It is used as a display screen in calculators.
3. For displaying images used in digital cameras.
4. The television is the main application of LCD.
5. Mostly the computer monitor is made up of LCDs.

Advantage
1.Low cost
2.Low Weight
3.Small size
4.Low power consumption
Disadvantage:-
1. LCDs are temperature-dependent (0-70°C)
2. LCDs do not emit light; as a result, the image has very little contrast.
3. LCDs have no color capability.
4. The resolution is not as good as that of a CRT.

OUTPUT PRIMITIVES
1.The Primitives are the simple geometric functions that are used to generate various Computer Graphics required by the User.
for example,Some most basic Output primitives are point-position(pixel), and a straight line
2.A In raster display, a picture is completely specified by the set of intensities for the pixel positions in the display.
3.At the other extreme, we can describe a picture as a set of complex objects, such as trees and terrain or furniture and walls,
positioned at specified coordinate locations within the scene.
4.Shapes and colors of the objects can be described internally with pixel arrays or with sets of basic geometric structures.
5.such as straight line segments and polygon color areas. The scene is then displayed either by loading the pixel arrays into the
frame buffer.
6.A frame buffer stores the pixel location and other information such as intensity, color of the pixel position that is to be
generated on the screen.
7.Here we start by device-level algorithms for displaying two-dimensional output primitives

1.Point:
The header file graphics.h contains putpixel() function which plots a pixel at location (x, y) of specified color.
Syntax :
putpixel(int x, int y, int color);
where,(x, y) is the location at which pixel is to be put , and color specifie the color of the pixel.
2.Line

Chapter 01 Compiled Dashrath Kale Computer Graphics


Line function is used to draw the line on the screen.
Syntax: line(x1,y1,x2,y2);
Example:-line(100,100,200,10)
3.Marker
Syntax: DrawMarker(A[2][n]):This is similar to the DrawPoly() function,but replaces the pixel along the polygon
boundary with the specified marker style.
drawpoly( int number, int *polypoints );
where,number indicates (n + 1) number of points where n is the number of vertices in a polygon. polypoints points to
a sequence of (n*2) integers.
4.Text
Syntax:outtextxy(x,y,"Hello World"); Paints the text specified by variable strings starting from position(x,y).

Program on Output Primitive:

Graphics mode:- It is Graphics mode which is a computer display mode that generates image using pixels.DETECT is a macro
defined in "graphics.h" header file
Initgraph():- It initializes the graphics system by loading a graphics driver from disk
Closegraph():- it function closes the graphics mode and deallocates all memory allocated by the graphics system .

#include<stdio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm,color,i[]={20,100,120,100,100,120,20,100};
initgraph(&gd,&gm,NULL);
putpixel(20,20,RED);
outtextxy(20,23,"1.Pixel");
line(20,50,100,50);
outtextxy(20,55,"2.Line");
drawpoly(4,i);
outtextxy(20,120,"3.Polygon");
outtextxy(20,120,"3.Polygon");
outtextxy(20,150,"4.Text");
getch();
closegraph();
return 0;
}

Chapter 01 Compiled Dashrath Kale Computer Graphics


OUTPUT OF PROGRAM..

Graphics function and Standards


1.The primary goal of standardized graphics software is portability.
2.When packages are designed with standard graphics functions, software can be moved easily from one hardware system to
another and used in different implementations and applications.
3.Without standards, programs designed for one hardware system often cannot be transferred to another system without
extensive rewriting of the programs.
GRAPHICS STANDARDS
1.After lots of efforts, two general standards have been developed:
1.GKS 2.PHIGS
1.GKS - Graphical Kernel System
1.This system was adopted as the first graphics software standard by the International Standards Organization (ISO) and by
various national standards organizations, including the American National Standards Institute (ANSI).
2.GKS was originally designed as a two-dimensional graphics package
3.A three-dimensional GKS extension was also subsequently developed.
4.The five main primitives in GKS are:
1. polyline: which draws a sequence of connected line segments.
2. polymarker: which marks a sequence of points with the same symbol.
3. fill area: which displays a specified area.
4. text: which draws a string of characters.
5. cell array: which displays an image composed of a variety of colours or grey scales.

Application of Concept/ Examples in real life​:


GKS standard To give for
1. portability of application graphics programs.
2. To assist in the learning of graphics systems by application programmers.
3. To offer strategy for manufacturers in relating practical graphics capabilities.

2.PHIGS – Programmer's Hierarchical Interactive Graphics Standard


1.This is the second software standard to be developed.
2.It features increased capabilities for object modelling, colour specifications, surface rendering, and picture manipulations
than GKS.
3.An extension of PHIGS, called PHIGS+, was developed to provide three dimensional surface-shading capabilities not available
in PHIGS.
4.Although PHIGS presents a specification for basic graphics functions, it does not provide a standard methodology for a
graphics interface to output devices, nor does it specify methods for storing and transmitting pictures.
5.Separate standards have been developed for these areas.
6.Standardization for device interface methods is given in the Computer Graphics Interface (CGI) system.
7.The Computer Graphics Metafile (CGM) system specifies standards for archiving and transporting pictures.
PHIGS application:-
PHIGS is useful for applications that manipulate complex displays of 2D or 3D data in a highly interactive environment.

Graphics Function.
1.Putpixel
Purpose:-Putpixel function is to draw the pixel on the screen. Pixel is a small dot on the screen.
Syntax:-putpixel(x co-orinate, y co-ordinate,COLOR);
Example: – putpixel(100,100,BLUE);

2.SetbkColor
Purpose:-Setbkcolor function is used to set background color of the screen.
Syntax:-setbkcolor(COLOR);
Example:-setbkcolor(RED);
3.Setlinestyle

Purpose:-setlinestyle function is used to set the current line style, width and pattern
Syntax:-setlinestyle(linestyle, upattern, thickness);
Example:-setlinestyle(SOLID_LINE,1,2);

4.Setcolor

Chapter 01 Compiled Dashrath Kale Computer Graphics


Purpose:-setcolor is to set color of the objects which are to be drawn after this setcolor line.
Syntax:-setcolor(COLOR);
Example:-setcolor(RED);

5.Rectangle:-
Purpose:- Rectangle function is used to draw the rectangle on the screen. X1,y1 are the lower left co-ordinates of the rectangle
and the x2,y2 are the upper right co-ordinates of the rectangle.
Syntax:– rectangle(x1,,y1,x2,y2);
Example:– rectangle(100,100,200,200);

6.Textheight
Purpose:-textheight returns the height of a string in pixels.
Syntax:-textheight(STRING);
Example:-i=textheight(“HELLO”);

7.Textwidth
Purpose:-textwidth returns the width of a string in pixels
Syntax:-textwidth(STRING);
Example:- i=textwidth(“HELLO”);

8.Getx
Purpose:-getx returns the current position of x o-ordinate
Syntax:-getx();
Example:- x=getx();

9.Gety
Purpose:-gety returns the current position of y co-ordinate
Syntax:-gety();
Example:- y=gety();

10.Getmaxx
Purpose:-getmaxx returns the maximum x co-ordinate on the screen
Syntax:-getmaxx();
Example:-maxx=getmaxx();

11.Getmaxy
Purpose:-getmaxy returns the maximum y co-ordinate on the screen
Syntax:-getmaxy();
Example:-maxy=getmaxy();

12.Line
Purpose:-Line function is used to draw the line on the screen.
Syntax: line(x1,y1,x2,y2);
Example:-line(100,100,200,100);

13.Closegraph
Purpose:-closegraph function shut down the graphic system
Syntax:- closegraph();
Example:- closegraph();

14.Moveto
Purpose:-moveto function moves current cursor position on the screen
Syntax:- moveto(x co-ordinate, y co-ordinate);
Example:- moveto(getmaxx/2, getmaxy/2);

15.Settextstyle
Purpose:-settextstyle sets the current text characteristics like font, direction and size
Syntax:-settextstyle(font, direction, size);
Example:-settextstyle(1,1,10);

16.Circle
Purpose: Circle function is used to draw the circle on the screen
Syntax:– circle(x,y,radius);
Example:circle(100,100,50);

17.Cleardevice

Chapter 01 Compiled Dashrath Kale Computer Graphics


Purpose: cleardevice function is used to clear the contents or graphic images on the screen in graphics mode.
Syntax:cleardevice();
Example:cleardevice();

18.Outtextxy
Purpose: outtextxy function is used to print the text on the screen in graphics mode.
Syntax:outtext(x,y,text);
Example:-outtextxy(100,100,”HELLO”);

19.Sector
Purpose:sector function draws and fills an elliptical pie slice.
Syntax:sector(x, y, starting angle, ending angle, xradius, yradius);
Example:sector(100,100,45 135 100 50);

20.Arc
Purpose:arc draws the arc on the screen, arc is a part of the circle
Syntax:arc(x, y, starting angle, ending angle, radius);
Example:arc( 100,100,90,180,50);

21.Floodfill
Purpose:floodfill function is used to fill the color in the object, object may be circle, rectangle or any other closed image.
Syntax:floodfill(x,y,boundary color);
Example:floodfill(100,100,BLUE);
22.Ellipse
Purpose:ellipse function is used to draw the ellipse on the screen.
Syntax:ellipse(x, y, starting angle, ending angle, xradius, yradius);
Example:ellipse(100,100,90,200,20,20);

23.Outtext
Purpose:outtext function is used to display the text on the screen, using this function text is displayed in the current position.
Syntax:outtext(STRING);
Example:outtex(“HELLO”);

24.Getcolor
Purpose:getcolor returns the current drawing color.
Syntax:getcolor();
Example:intclr = getcolor();

25.Getpixel
Purpose:getpixel gets the color of a specified pixel.
Syntax:getpixel(x,y);
Example: color=getpixel(100,100);

26.Setfillstyle
Purpose: setfillstyle is used to set the color and style to be filled in the object using the flood fill method.
Syntax:setfillstyle(STYLE, COLOR);
Example:setfillstyle(1,RED)

Chapter 01 Compiled Dashrath Kale Computer Graphics


1.Virtual Reality:-
1.Virtual reality is the term used to describe a three-dimensional,
computer generated environment which can be explored and interacted
with by a person.
2.Virtual Reality (VR) is the use of computer technology to create a
simulated environment.Instead of viewing a screen in front of them,
users are immersed and able to interact with 3D worlds.
3.By simulating as many senses as possible, such as vision, hearing,
touch, even smell, the computer is transformed into a gatekeeper to this
artificial world.
4.Virtual Reality (VR) is the use of computer technology to create a
simulated environment.
5.Virtual Reality’s most immediately-recognizable component is the
head-mounted display (HMD).
6.Major players in Virtual Reality include HTC Vive, Oculus Rift and
PlayStation VR (PSVR).
7.The simulated world does not necessarily have to obey natural laws of behavior.
Types of Virtual Reality:-

1.Fully-immersive simulations:-

1.It’s complete with head-mounted displays, headphones, gloves, and


maybe a treadmill or some kind of suspension apparatus.
2.This type of VR is commonly used for gaming and other entertainment
purposes in VR arcades or even in your home (empty, non-fragile room
advised.)
3.Fully-immersive simulations give users the most realistic experience
possible, complete with sight and sound.
4.The VR headsets provide high-resolution content with a wide field of
view. Whether you’re flying or fighting the bad guys, you’ll feel like
you’re really there.

2.Semi-immersive simulations:-

1.Semi-immersive experiences provide users with a partially virtual


environment.
2.This type of VR is mainly used for educational and training purposes
and the experience is made possible with graphical computing and
large projector systems.
3.In this example, the instruments in front of the pilot are real and the
windows are screens displaying virtual content.

3.Non-immersive simulations:-

1.Non-immersive simulations are often forgotten as an actual type of


VR, honestly because it’s very common in our everyday lives.
2.The average video game is technically considered a non-immersive
virtual reality experience. Think about it, you’re sitting in a physical
space, interacting with a virtual one.

Applications Virtual Reality:-


1.Entertainment (i.e. video games)
2.Educational purposes (i.e. medical or military training).

Advantages Of Using Virtual Reality


1.Quality visualizations.
2.A solution to language barrier.
3.Increases levels of interest.
4.Facilitates retention of information.

Chapter 01 Compiled Dashrath Kale Computer Graphics


Disadvantages of Virtual Reality
1.It can be addictive.
2.Provides no room for interaction.
3.It is expensive.

2.Augmented Reality.:-

1.Augmented reality is the technology that expands our physical world,


adding layers of digital information onto it.
2.Unlike Virtual Reality (VR), AR does not create the whole artificial
environment to replace real with a virtual one.
3.AR appears in direct view of an existing environment and adds sounds,
videos, graphics to it.
4.A view of the physical real-world environment with superimposed
computer-generated images, thus changing the perception of reality, is
the AR.
5.Augmented reality is commonly used in electronic first-person shooter
games to add environmental, health, and other information to players’ viewpoints.
6.Such information may be supplied using a global positioning system (GPS) linked to a commercial or open-source database.

Types of Augmented Reality

1.Marker Based Augmented Reality

Marker-based augmented reality (also called Image Recognition) uses a


camera and some type of visual marker, such as a QR/2D code
It produces a result only when the marker is sensed by a reader.
Marker based applications use a camera on the device to distinguish a
marker from any other real world object.

2.Projection Based Augmented Reality.

1.Projection based augmented reality works by projecting artificial light


onto real world surfaces.
2.Projection based augmented reality applications allow for human
interaction by sending light onto a real world surface and then sensing the
human interaction (i.e. touch) of that projected light.
3.Detecting the user’s interaction is done by differentiating between an
expected (or known) projection and the altered projection.

3.Superimposition Based Augmented Reality

Superimposition based augmented reality either partially or fully replaces


the original view of an object with a newly augmented view of that same
object.
A strong consumer-facing example of superimposition based augmented
reality could be found in the Ikea augmented reality furniture catalogue.
By downloading an app and scanning selected pages in their printed or
digital catalogue, users can place virtual ikea furniture in their own home
with the help of augmented reality.

Chapter 01 Compiled Dashrath Kale Computer Graphics


Applications Augmented Reality:-
● smartphones to display information such as building addresses.
● Real estate signs
● Retail sales offers.
● Restaurant reviews on specific sites seen through the devices’ viewfinder or electronic displays.
Advantage of Augmented Reality:-
1.It reduces the line between real world and virtual world.
2.It enhances perceptions and interactions with the real world.
3.It can be used by anyone as per applications.
4.It can be used by military people without putting their life in danger by way of battle field simulation before the actual war.
5.This will also help them in actual war to make critical decisions.

Disadvantage of Augmented Reality:-


1.It is expensive to develop AR technology based projects and to maintain it. Moreover production of AR based devices is
costly.
2.Lack of privacy is a concern in AR based applications.
3.In AR, people are missing out on important moments.
4.Low performance level is a concern which needs to be addressed during the testing process.
5.It requires basic learning to effectively use AR compliant devices.

Chapter 01 Compiled Dashrath Kale Computer Graphics


Chapter 01 Compiled Dashrath Kale Computer Graphics

You might also like