SlideShare a Scribd company logo
1 of 11
COMPUTER GRAPHICS -
DANCING DOLL
BASICS:
Computer graphics is an art of drawing pictures on computer screens with the help
of programming and algorithms. It involves computations, creation, and
manipulation of data. In other words, we can say that computer graphics is a
rendering tool for the generation and manipulation of images.
Application of Computer Graphics
1.Computer graphics user interfaces (GUIs). 2.Business presentation graphics
3.Cartography Weather Maps 4.Satellite Imaging Photo Enhancement
5.Medical Imaging 6.Engineering drawings
7.Typography 8.Architecture Art
9.Entertainment 10.Simulation and modeling
GRAPHICS.H
Used to draw different shapes, display text in different fonts, change colors and many more. Using functions of
graphics.h in Turbo C compiler you can make graphics programs, animations, projects, and games. You can draw
circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available
functions and fill them. Following is a list of functions of graphics.h header file. Every function is discussed with the
arguments it needs, its description
GRAPHICS.H FUNCTIONS
arc bar bar3d circle
cleardevice closegraph drawpoly ellipse
fillellipse fillpoly floodfill getarccords
getbkcolor getcolor getdrivername getimage
getmaxcolor getmaxx getmaxy getpixel
getx gety graphdefaults grapherrormsg
imagesize line lineto linerel
moveto moverel outtext outtextxy
pieslice putimage putpixel rectangle
sector setbkcolor setcolor setfillstyle
setlinestyle settextstyle setviewport textheight textwidth
BASICS: LINE GENERATION ALGORITHM
In any 2-Dimensional plane if we connect two points (x0, y0) and (x1, y1), we get a line segment. But in the
case of computer graphics we can not directly join any two coordinate points, for that we should
CALCULATE INTERMEDIATE POINT’S COORDINATE and put a pixel for each intermediate point, of
the desired color with help of functions like putpixel(x, y, K) in C, where (x,y) is our co-ordinate and K
denotes some color
 DDAALGORITHM
 BRESENHAM’S LINE GENERATION
 MID-POINT ALGORITHM
DDA- LINE GENERATION ALGORITHM
Consider one point of the line as (X0,Y0) and the second point of the line as (X1,Y1).
// calculate dx , dy
dx = X1 - X0;
dy = Y1 - Y0;
// Depending upon absolute value of dx & dy
// choose number of steps to put pixel as
// steps = abs(dx) > abs(dy) ? abs(dx) : abs(dy)
steps = abs(dx) > abs(dy) ? abs(dx) : abs(dy);
// calculate increment in x & y for each steps
Xinc = dx / (float) steps;
Yinc = dy / (float) steps;
// Put pixel for each step
X = X0;
Y = Y0;
for (int i = 0; i <= steps; i++)
{
putpixel (X,Y,WHITE);
X += Xinc;
Y += Yinc;
}
BASICS: CIRCLE GENERATION ALGORITHM
 Drawing a circle on the screen is a little complex than drawing a line. There are two popular
algorithms for generating a circle: Bresenham’s Algorithm and Midpoint Circle Algorithm.
These algorithms are based on the idea of determining the subsequent points required to draw
the circle. Bresenham’s Algorithm:
Step 1 − Get the coordinates of the center of the circle and radius, and store them in
x, y, and R respectively. Set P=0 and Q=R.
Step 2 − Set decision parameter D = 3 – 2R.
Step 3 − Repeat through step-8 while P ≤ Q.
Step 4 − Call Draw Circle X,Y,P,QX,Y,P,Q.
Step 5 − Increment the value of P.
Step 6 − If D < 0 then D = D + 4P + 6.
Step 7 − Else Set R = R - 1, D = D + 4P−QP−Q + 10.
Step 8 − Call Draw Circle X,Y,P,Q.
putpixel (X + P, Y + Q)
putpixel (X - P, Y + Q)
putpixel (X + P, Y - Q)
putpixel (X - P, Y - Q)
putpixel (X + Q, Y + P)
putpixel (X - Q, Y + P)
putpixel (X + Q, Y - P)
putpixel (X - Q, Y - P)
BASICS: POLYGON FILLING
Polygon is an ordered list of vertices as shown in the following figure. For filling polygons with
particular colors, you need to determine the pixels falling on the border of the polygon and
those which fall inside the polygon.
Scan Line Algorithm
Flood Fill Algorithm
Boundary Fill Algorithm
4-Connected Polygon
8-Connected Polygon
Inside-outside Test : 1. Odd-Even Rule 2.Nonzero winding number rule
COMPUTER ANIMATION
The basic idea behind animation is to play back the recorded images at the rates fast enough to
fool the human eye into interpreting them as continuous motion. Animation can make a series of
dead images come alive. Animation can be used in many areas like entertainment, computer
aided-design, scientific visualization, training, education, e-commerce, and computer art.
Traditional Animation (frame by frame) : Key Framing
 A keyframe is a frame where we define changes in animation. Every frame is a keyframe when we
create frame by frame animation. When someone creates a 3D animation on a computer, they usually
don’t specify the exact position of any given object on every single frame. They create keyframes.
 Keyframes are important frames during which an object changes its size, direction, shape or other
properties. The computer then figures out all the in-between frames and saves an extreme amount of
time for the animator. The following illustrations depict the frames drawn by user and the frames
generated by computer.
DANCING DOLL: Visualization
Initial position
DANCING DOLL: CODE & OUTPUT
DANCING DOLL: DANCING DOLL

More Related Content

What's hot

Color models in Digitel image processing
Color models in Digitel image processingColor models in Digitel image processing
Color models in Digitel image processingAryan Shivhare
 
Chapter 8 Video
Chapter 8 VideoChapter 8 Video
Chapter 8 Videoshelly3160
 
IRJET- Detection and Classification of Skin Diseases using Different Colo...
IRJET-  	  Detection and Classification of Skin Diseases using Different Colo...IRJET-  	  Detection and Classification of Skin Diseases using Different Colo...
IRJET- Detection and Classification of Skin Diseases using Different Colo...IRJET Journal
 
Image Processing with OpenCV
Image Processing with OpenCVImage Processing with OpenCV
Image Processing with OpenCVdebayanin
 
Introduction to game development
Introduction to game developmentIntroduction to game development
Introduction to game developmentAbdelrahman Ahmed
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive SachiniGunawardana
 
Cohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmCohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmTawfiq Ahmed
 
CATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSCATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSnehrurevathy
 
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxFAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxBasavaPrabhu14
 
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICSATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICSnehrurevathy
 
Wine Quality Analysis Using Machine Learning
Wine Quality Analysis Using Machine LearningWine Quality Analysis Using Machine Learning
Wine Quality Analysis Using Machine LearningMahima -
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_openglManas Nayak
 

What's hot (20)

Color models in Digitel image processing
Color models in Digitel image processingColor models in Digitel image processing
Color models in Digitel image processing
 
Chapter 8 Video
Chapter 8 VideoChapter 8 Video
Chapter 8 Video
 
IRJET- Detection and Classification of Skin Diseases using Different Colo...
IRJET-  	  Detection and Classification of Skin Diseases using Different Colo...IRJET-  	  Detection and Classification of Skin Diseases using Different Colo...
IRJET- Detection and Classification of Skin Diseases using Different Colo...
 
Image Processing with OpenCV
Image Processing with OpenCVImage Processing with OpenCV
Image Processing with OpenCV
 
Computer graphices presentation
Computer graphices presentationComputer graphices presentation
Computer graphices presentation
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
Bitmap graphics
Bitmap graphicsBitmap graphics
Bitmap graphics
 
Introduction to game development
Introduction to game developmentIntroduction to game development
Introduction to game development
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
lecture1 introduction to computer graphics(Computer graphics tutorials)
lecture1 introduction to computer graphics(Computer graphics tutorials)lecture1 introduction to computer graphics(Computer graphics tutorials)
lecture1 introduction to computer graphics(Computer graphics tutorials)
 
Attributes of output Primitive
Attributes of output Primitive Attributes of output Primitive
Attributes of output Primitive
 
Cohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmCohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithm
 
Multimedia chapter 4
Multimedia chapter 4Multimedia chapter 4
Multimedia chapter 4
 
CATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICSCATHODE RAY TUBE IN COMPUTER GRAPHICS
CATHODE RAY TUBE IN COMPUTER GRAPHICS
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptxFAKE CURRENCY DETECTION PDF NEW PPT.pptx
FAKE CURRENCY DETECTION PDF NEW PPT.pptx
 
Color models
Color modelsColor models
Color models
 
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICSATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
ATTRIBUTES OF OUTPUT PRIMITIVES IN COMPUTER GRAPHICS
 
Wine Quality Analysis Using Machine Learning
Wine Quality Analysis Using Machine LearningWine Quality Analysis Using Machine Learning
Wine Quality Analysis Using Machine Learning
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_opengl
 

Similar to COMP GRAPHICS - DANCING DOLL (20)

Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Computer graphics notes watermark
Computer graphics notes watermarkComputer graphics notes watermark
Computer graphics notes watermark
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Unit 2
Unit 2Unit 2
Unit 2
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
Primitives
PrimitivesPrimitives
Primitives
 
Computer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdfComputer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdf
 
mini prjt
mini prjtmini prjt
mini prjt
 
Computer graphics
Computer graphics Computer graphics
Computer graphics
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Unit-1 basics of computer graphics
Unit-1 basics of computer graphicsUnit-1 basics of computer graphics
Unit-1 basics of computer graphics
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algo
 
paper
paperpaper
paper
 
UNIT-II
UNIT-IIUNIT-II
UNIT-II
 

More from Bhavya Chawla

Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Bhavya Chawla
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingBhavya Chawla
 
Ethical Hacking - sniffing
Ethical Hacking - sniffingEthical Hacking - sniffing
Ethical Hacking - sniffingBhavya Chawla
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management SystemBhavya Chawla
 
evolution of computers
 evolution of computers evolution of computers
evolution of computersBhavya Chawla
 
the generation of computers
the generation of computersthe generation of computers
the generation of computersBhavya Chawla
 

More from Bhavya Chawla (7)

Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Ethical Hacking - sniffing
Ethical Hacking - sniffingEthical Hacking - sniffing
Ethical Hacking - sniffing
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
evolution of computers
 evolution of computers evolution of computers
evolution of computers
 
the generation of computers
the generation of computersthe generation of computers
the generation of computers
 

Recently uploaded

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 

COMP GRAPHICS - DANCING DOLL

  • 2. BASICS: Computer graphics is an art of drawing pictures on computer screens with the help of programming and algorithms. It involves computations, creation, and manipulation of data. In other words, we can say that computer graphics is a rendering tool for the generation and manipulation of images. Application of Computer Graphics 1.Computer graphics user interfaces (GUIs). 2.Business presentation graphics 3.Cartography Weather Maps 4.Satellite Imaging Photo Enhancement 5.Medical Imaging 6.Engineering drawings 7.Typography 8.Architecture Art 9.Entertainment 10.Simulation and modeling
  • 3. GRAPHICS.H Used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h in Turbo C compiler you can make graphics programs, animations, projects, and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. Following is a list of functions of graphics.h header file. Every function is discussed with the arguments it needs, its description GRAPHICS.H FUNCTIONS arc bar bar3d circle cleardevice closegraph drawpoly ellipse fillellipse fillpoly floodfill getarccords getbkcolor getcolor getdrivername getimage getmaxcolor getmaxx getmaxy getpixel getx gety graphdefaults grapherrormsg imagesize line lineto linerel moveto moverel outtext outtextxy pieslice putimage putpixel rectangle sector setbkcolor setcolor setfillstyle setlinestyle settextstyle setviewport textheight textwidth
  • 4. BASICS: LINE GENERATION ALGORITHM In any 2-Dimensional plane if we connect two points (x0, y0) and (x1, y1), we get a line segment. But in the case of computer graphics we can not directly join any two coordinate points, for that we should CALCULATE INTERMEDIATE POINT’S COORDINATE and put a pixel for each intermediate point, of the desired color with help of functions like putpixel(x, y, K) in C, where (x,y) is our co-ordinate and K denotes some color  DDAALGORITHM  BRESENHAM’S LINE GENERATION  MID-POINT ALGORITHM
  • 5. DDA- LINE GENERATION ALGORITHM Consider one point of the line as (X0,Y0) and the second point of the line as (X1,Y1). // calculate dx , dy dx = X1 - X0; dy = Y1 - Y0; // Depending upon absolute value of dx & dy // choose number of steps to put pixel as // steps = abs(dx) > abs(dy) ? abs(dx) : abs(dy) steps = abs(dx) > abs(dy) ? abs(dx) : abs(dy); // calculate increment in x & y for each steps Xinc = dx / (float) steps; Yinc = dy / (float) steps; // Put pixel for each step X = X0; Y = Y0; for (int i = 0; i <= steps; i++) { putpixel (X,Y,WHITE); X += Xinc; Y += Yinc; }
  • 6. BASICS: CIRCLE GENERATION ALGORITHM  Drawing a circle on the screen is a little complex than drawing a line. There are two popular algorithms for generating a circle: Bresenham’s Algorithm and Midpoint Circle Algorithm. These algorithms are based on the idea of determining the subsequent points required to draw the circle. Bresenham’s Algorithm: Step 1 − Get the coordinates of the center of the circle and radius, and store them in x, y, and R respectively. Set P=0 and Q=R. Step 2 − Set decision parameter D = 3 – 2R. Step 3 − Repeat through step-8 while P ≤ Q. Step 4 − Call Draw Circle X,Y,P,QX,Y,P,Q. Step 5 − Increment the value of P. Step 6 − If D < 0 then D = D + 4P + 6. Step 7 − Else Set R = R - 1, D = D + 4P−QP−Q + 10. Step 8 − Call Draw Circle X,Y,P,Q. putpixel (X + P, Y + Q) putpixel (X - P, Y + Q) putpixel (X + P, Y - Q) putpixel (X - P, Y - Q) putpixel (X + Q, Y + P) putpixel (X - Q, Y + P) putpixel (X + Q, Y - P) putpixel (X - Q, Y - P)
  • 7. BASICS: POLYGON FILLING Polygon is an ordered list of vertices as shown in the following figure. For filling polygons with particular colors, you need to determine the pixels falling on the border of the polygon and those which fall inside the polygon. Scan Line Algorithm Flood Fill Algorithm Boundary Fill Algorithm 4-Connected Polygon 8-Connected Polygon Inside-outside Test : 1. Odd-Even Rule 2.Nonzero winding number rule
  • 8. COMPUTER ANIMATION The basic idea behind animation is to play back the recorded images at the rates fast enough to fool the human eye into interpreting them as continuous motion. Animation can make a series of dead images come alive. Animation can be used in many areas like entertainment, computer aided-design, scientific visualization, training, education, e-commerce, and computer art. Traditional Animation (frame by frame) : Key Framing  A keyframe is a frame where we define changes in animation. Every frame is a keyframe when we create frame by frame animation. When someone creates a 3D animation on a computer, they usually don’t specify the exact position of any given object on every single frame. They create keyframes.  Keyframes are important frames during which an object changes its size, direction, shape or other properties. The computer then figures out all the in-between frames and saves an extreme amount of time for the animator. The following illustrations depict the frames drawn by user and the frames generated by computer.
  • 10. DANCING DOLL: CODE & OUTPUT