



C++ ::: COMPUTER GRAPHICS 


This section C++ : Computer Graphics contains C++ programs for drawing the basic functions of Graphics like Lines, Circles, Ellipses, etc. This section also contains other 2D and 3D programs on different techniques in Computer Graphics. These Programs are well formatted and are very easy to understand.

Note: All the given files are in zip format, which can be uncompressed with the help of a compression tool. If you do not have any tool, then you can get one from Utilities : Compression Tools. 


Line 






CG01 

A C++ Program to draw a line using Cartesian SlopeIntercept Equation [ Simple Implementation ]. 
CG02 

A C++ Program to draw a line using Cartesian SlopeIntercept Equation. 
CG03 

A C++ Program to draw a line using Parametric Equations. 
CG04 

A C++ Program to draw a line using Digital Differential Analyzer (DDA) Algorithm. 
CG05 

A C++ Program to draw a line using Bresenham's Line Algorithm (BLA) for lines with slopes negative and less than 1. 
CG06 

A C++ Program to draw a line using Bresenham's Line Algorithm (BLA) for lines with slopes negative and greater than 1. 
CG07 

A C++ Program to draw a line using Bresenham's Line Algorithm (BLA) for lines with slopes positive and less than 1. 
CG08 

A C++ Program to draw a line using Bresenham's Line Algorithm (BLA) for lines with slopes positive and greater than 1. 
CG09 

A C++ Program to draw a line using Bresenham's Line Algorithm (BLA). 





Line Styles 






CG10 

A C++ program to draw different kinds of Dashed Lines using Bresenham's Line Algorithm. 
CG11 

A C++ program to draw different kinds of Thick Lines using Bresenham's Line Algorithm. 





Polygons 






CG12 

A C++ Program to draw a Triangle using Bresenham's Line Algorithm. 
CG13 

A C++ Program to draw a Rectangle using Bresenham's Line Algorithm. 
CG14 

A C++ Program to draw a Polygon using Bresenham's Line Algorithm. 





Circle 






CG15 

A C++ Program to draw a circle using Polynomial Method. 
CG16 

A C++ Program to draw a circle using Trigonometric Method. 
CG17 

A C++ Program to draw a circle using Bresenham's Circle Algorithm. 
CG18 

A C++ Program to draw a circle using MidPoint Circle Algorithm. 





Ellipse 






CG19 

A C++ Program to draw an ellipse using Polynomial Method. 
CG20 

A C++ Program to draw an ellipse using Trigonometric Method. 
CG21 

A C++ Program to draw an ellipse using MidPoint Ellipse Algorithm. 





Arcs 






CG22 

A C++ Program to draw a Circular Arc using Trigonometric Method. 
CG23 

A C++ Program to draw an Elliptical Arc using Trigonometric Method. 





Curves 






CG24 

A C++ Program to draw a CCurve of nth order. 
CG25 

A C++ Program to draw a KCurve of nth order. 
CG26 

A C++ Program to draw a Cubic Bezier Curve 
CG27 

A C++ Program to draw a Bezier Curve of nth degree. 





Area Filling 






CG28 

A C++ Program to fill differnt geometric shapes by using Boundary Fill Algorithm. 
CG29 

A C++ Program to fill differnt geometric shapes by using Flood Fill Algorithm. 
CG30 

A C++ Program to fill a Polygon using ScanLine Polygon Fill Algorithm. 
CG31 

A C++ Program to fill a Rectangle using ScanLine Rectangle Fill Algorithm. 
CG32 

A C++ Program to fill a Circle using ScanLine Circle Fill Algorithm. 
CG33 

A C++ Program to fill a Circle using ScanLine Circle Fill Algorithm using Polar Coordinates. 
CG34 

A C++ Program to fill differnt geometric shapes by using Boundary Fill Algorithm using LinkedList. 
CG35 

A C++ Program to fill differnt geometric shapes by using Flood Fill Algorithm using LinkedList. 





Character Generation 






CG36 

A C++ Program to generate Udru Alphabets using Stroke Method. 
CG37 

A C++ Program to generate Udru Alphabets using Matrix Method. 





2D Transformations 






CG38 

A C++ Program to illustrate the implementation of Translation Transformation. 
CG39 

A C++ Program to illustrate the implementation of Scaling Transformation. 
CG40 

A C++ Program to illustrate the implementation of Scaling Transformation along a Fixed Point. 
CG41 

A C++ Program to illustrate the implementation of Scaling Transformation along Arbitrary Direction. 
CG42 

A C++ Program to illustrate the implementation of Rotation Transformation. 
CG43 

A C++ Program to illustrate the implementation of Rotation Transformation along a Pivot Point. 
CG44 

A C++ Program to illustrate the implementation of Reflection Transformation about xaxix, yaxis and w.r.t origin. 
CG45 

A C++ Program to illustrate the implementation of Reflection Transformation about the line y=x and y=x. 
CG46 

A C++ Program to illustrate the implementation of XDirection Shear Transformation. 
CG47 

A C++ Program to illustrate the implementation of YDirection Shear Transformation. 





2D Viewing  Clipping 






CG48 

A C++ Program to show the implementation of WindowtoViewport Coordinate Transformaton. 
CG49 

A C++ Program to show the implementation of Point Clipping Algorithm. 
CG50 

A C++ Program to show the implementation of CohenSutherland Line Clipping Algorithm. 
CG51 

A C++ Program to show the implementation of CohenSutherland MidPoint Subdivision Line Clipping Algorithm. 
CG52 

A C++ Program to show the implementation of LiangBarsky Line Clipping Algorithm. 
CG53 

A C++ Program to show the implementation of SutherlandHodgeman Polygon Clipping Algorithm. 
CG54 

A C++ Program to show the implementation of WindowtoViewport Transformaton. 
CG55 

A C++ program to show the implementation of NoneorAll String Clipping Strategy. 
CG56 

A C++ program to show the implementation of NoneorAll Character Clipping Strategy. 





Projection 






CG57 

A C++ Program to show the projection of 3D objects using Standard Perspective Projection. 
CG58 

A C++ Program to show the projection of 3D objects using Standard Perspective Projection w.r.t. an Arbitrary Plane and Center of Projection is the origion i.e. C(0,0,0). 
CG59 

A C++ Program to show the projection of 3D objects using General Perspective Projection. 
CG60 

A C++ Program to show the projection of 3D objects using Orthographics Projection Parallel onto xyplane. 
CG61 

A C++ Program to show the projection of 3D objects using Orthographics Parallel Projection w.r.t. xyplane & along vector v. 
CG62 

A C++ Program to show the projection of 3D objects using General Oblique Parallel Projection onto xyplane. 
CG63 

A C++ Program to show the projection of 3D objects using Cavalier Oblique Parallel Projection onto xyplane (angle=45). 
CG64 

A C++ Program to show the projection of 3D objects using Cabinet Oblique Parallel Projection onto xyplane (angle=30). 





3D Object Representations 






CG65 

A C++ Program to illustrate the implementation of PolygonMesh Representation. 
CG66 

A C++ Program that creats a 3D solid object using Translational Sweep Representatiom Method. 
CG67 

A C++ Program that creats a 3D solid object using Rotational Sweep Representatiom Method. 





Quadratic Surfaces 






CG68 

A C++ Program to draw a Sphere using Ellipses. 
CG69 

A C++ Program to draw a Sphere using Parametric Equations. 
CG70 

A C++ Program to draw an Ellipsoid using Parametric Equations. 





Bezier Curves  Surfaces 






CG71 

A C++ Program to draw a 3D Cubic Bezier Curve. 
CG72 

A C++ Program to draw a 3D Bezier Curve of Nth degree. 
CG73 

A C++ Program to draw a 3D PieceWise Bezier Curve of nth degree with Zeroth Order Continuity. 
CG74 

A C++ Program to draw a 3D Bezier Surface for MxN control Points. 





3D Transformations 






CG75 

A C++ Program to illustrate the implementation of Translation Transformation. 
CG76 

A C++ Program to illustrate the implementation of Scaling Transformation. 
CG77 

A C++ Program to illustrate the implementation of Scaling Transformation along a Fixed Point. 
CG78 

A C++ Program to illustrate the implementation of 3D Rotation Transformation along xaxis. 
CG79 

A C++ Program to illustrate the implementation of 3D Rotation Transformation along yaxis. 
CG80 

A C++ Program to illustrate the implementation of 3D Rotation Transformation along zaxis. 
CG81 

A C++ Program to show the 3D Reflection Transformation along xyplane. 
CG82 

A C++ Program to show the 3D Reflection Transformation along yzplane. 
CG83 

A C++ Program to show the 3D Reflection Transformation along zxplane. 
CG84 

A C++ Program to show the 3D Shearing Transformation along xaxis. 
CG85 

A C++ Program to show the 3D Shearing Transformation along yaxis. 
CG86 

A C++ Program to show the 3D Shearing Transformation along zaxis. 





Miscellaneous Programs 






CG87 

A C++ Program to generate a pattern as required by the following:  Read two values r and n.  Calculate the coordinates of 4n points around the edges of a square of side r.  There is one point at each corner.  The points are placed such that the distance b/w two consecutive points is r/n.  The Rule: P(I) is joined with P(J) for all I and J such that JI is a fibonacci number for number less than 4n, the subtraction being carried out modulo 4n.  The outer square must also be drawn.  For efficiency, there is no need to join points which lie on the same side of the square. 
CG88 

A C++ Program that places n equally spaced points on the circumference of a circle of radius r,and then join each point to every other point. 
CG89 

A C++ Program to draw a Chess Board. 
CG90 

A C++ Program to draw a Luddo Board. 




