SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

SENTIMENT ANALYSIS-AN OBJECTIVE VIEW
SENTIMENT ANALYSIS-AN OBJECTIVE VIEWSENTIMENT ANALYSIS-AN OBJECTIVE VIEW
SENTIMENT ANALYSIS-AN OBJECTIVE VIEWJournal For Research
 
Air Canvas: Draw in Air
Air Canvas: Draw in AirAir Canvas: Draw in Air
Air Canvas: Draw in AirIRJET Journal
 
IRJET- Fake Profile Identification using Machine Learning
IRJET-  	  Fake Profile Identification using Machine LearningIRJET-  	  Fake Profile Identification using Machine Learning
IRJET- Fake Profile Identification using Machine LearningIRJET Journal
 
Report on Finger print sensor and its application
Report on Finger print sensor and its applicationReport on Finger print sensor and its application
Report on Finger print sensor and its applicationArnab Podder
 
Touch Less Touch Screen Technology
Touch Less Touch Screen TechnologyTouch Less Touch Screen Technology
Touch Less Touch Screen Technologyijtsrd
 
Vehicle detection and speed detection
Vehicle detection and speed detectionVehicle detection and speed detection
Vehicle detection and speed detectionVenkat Projects
 
Electronic Paper (e-Paper)
Electronic Paper (e-Paper)Electronic Paper (e-Paper)
Electronic Paper (e-Paper)Seminar Links
 
Eye Movement based Human Computer Interaction Technique
Eye Movement based Human Computer Interaction TechniqueEye Movement based Human Computer Interaction Technique
Eye Movement based Human Computer Interaction TechniqueJobin George
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionNikyaa7
 
Sensor based Health Monitoring System
Sensor based Health Monitoring System Sensor based Health Monitoring System
Sensor based Health Monitoring System Sudhanshu Janwadkar
 
virtual mouse using hand gesture.pptx
virtual mouse using hand gesture.pptxvirtual mouse using hand gesture.pptx
virtual mouse using hand gesture.pptxsivaeswarreddy
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONNandana Priyanka Eluri
 
Artificial passenger
Artificial passengerArtificial passenger
Artificial passengerDhanya LK
 

Was ist angesagt? (20)

SENTIMENT ANALYSIS-AN OBJECTIVE VIEW
SENTIMENT ANALYSIS-AN OBJECTIVE VIEWSENTIMENT ANALYSIS-AN OBJECTIVE VIEW
SENTIMENT ANALYSIS-AN OBJECTIVE VIEW
 
Air Canvas: Draw in Air
Air Canvas: Draw in AirAir Canvas: Draw in Air
Air Canvas: Draw in Air
 
IRJET- Fake Profile Identification using Machine Learning
IRJET-  	  Fake Profile Identification using Machine LearningIRJET-  	  Fake Profile Identification using Machine Learning
IRJET- Fake Profile Identification using Machine Learning
 
Bus Pass.pptx
Bus Pass.pptxBus Pass.pptx
Bus Pass.pptx
 
Report on Finger print sensor and its application
Report on Finger print sensor and its applicationReport on Finger print sensor and its application
Report on Finger print sensor and its application
 
Touch Less Touch Screen Technology
Touch Less Touch Screen TechnologyTouch Less Touch Screen Technology
Touch Less Touch Screen Technology
 
PILL CAMERA
PILL CAMERAPILL CAMERA
PILL CAMERA
 
Vehicle detection and speed detection
Vehicle detection and speed detectionVehicle detection and speed detection
Vehicle detection and speed detection
 
Virtual keyboard abstract
Virtual keyboard abstractVirtual keyboard abstract
Virtual keyboard abstract
 
Electronic Paper (e-Paper)
Electronic Paper (e-Paper)Electronic Paper (e-Paper)
Electronic Paper (e-Paper)
 
Haptic devices
Haptic devicesHaptic devices
Haptic devices
 
Eye Movement based Human Computer Interaction Technique
Eye Movement based Human Computer Interaction TechniqueEye Movement based Human Computer Interaction Technique
Eye Movement based Human Computer Interaction Technique
 
Expense tracker
Expense trackerExpense tracker
Expense tracker
 
ATM with an EYE
ATM with an EYEATM with an EYE
ATM with an EYE
 
Automatic Attendance system using Facial Recognition
Automatic Attendance system using Facial RecognitionAutomatic Attendance system using Facial Recognition
Automatic Attendance system using Facial Recognition
 
Sensor based Health Monitoring System
Sensor based Health Monitoring System Sensor based Health Monitoring System
Sensor based Health Monitoring System
 
virtual mouse using hand gesture.pptx
virtual mouse using hand gesture.pptxvirtual mouse using hand gesture.pptx
virtual mouse using hand gesture.pptx
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
 
Eco Atm
Eco AtmEco Atm
Eco Atm
 
Artificial passenger
Artificial passengerArtificial passenger
Artificial passenger
 

Ähnlich wie 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
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentation
 
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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
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
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 

Kürzlich hochgeladen (20)

MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
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
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 

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