Computer Graphics

Color Generating Techniques- Computer Graphics

There are two ways by which you can see some objects colorful, let’s say RED – the first method would be – if you wear RED Glasses on your eyes and second method would be you color the object RED. In other words – either you paint the source (eyes) or the destination (Object). We...
Read More

Area Fill Algorithms

Flood Fill vs Boundary Algorithms Objective – Color the entire area with the color already present in the area. Flood fill algorithm This method is useful when area to be filled has multiple colors in it. Find any point in this area and replace it with fill color. Start filling the surrounding points using the...
Read More

Computer Graphics – Notes – Short Q & A’s

When it comes to scoring marks, short questions play a real significant role. Find answers like – aspect ratio, resolution, persistence and many more – rewritten in a simplified language.  Whats more these questions are picked from final question papers of various universities or schools...
Read More

3d Transformations Matrices and Equations

The major difference in 2d and 3d transformations is another dimension. 3d has one more dimension called z axis. The floor of the room is an example of 2d where in only two dimensions matters, one is length (x axis) and other one breadth (y axis). Lets include the height of the room, now you...
Read More

Cohen Sutherland Algorithm With Solved Example

Cohen Sutherland Algorithm Objective: The line to be clipped against the window. This means clip the line segment which is not visible in the window. Assumptions: x1,y1, and x2,y2 be the starting and endpoints of the line. Xmin, ymin and xmax,ymax be the starting and ending points of the window. As shown in the figure...
Read More

2d Scaling Transformation Numerical Examples

Problem Statement-1 Magnify a triangle placed at A (0,0), B (1,1) and C (5,2) to twice its size keeping the point C (5,2) Fixed. If the point C (5,2) needs to be fixed this means the transformation scaling needs to be done with respect to the point C (5,2). So, we will bring the point...
Read More

Numerical Examples of Rotation in 2d Transformation

Example – 2 (from Exams) Rotate a triangle placed at A(0,0), B(1,1) and C(5,2) by an angle 45 with respect to point P(-1,-1). The calculations available for computer graphics can be performed only at origin. It is a case of composite transformation which means this can be performed when more than one transformation is performed...
Read More

2d- Scaling Transformation

In simple words , scaling means an object can be viewed differently with various scales. An object with length 3cm might appear small when viewed with a scale in meters. Cars will appear bigger if you are looking down on the cars parked at a parking lot from 2nd floor of a building, but same...
Read More

2d Transformations – Computer Graphics

Welcome again to learn a complex topic simply. Learn by solving numerical problems. Let the theory take a back seat this time. Moving, Rotating , Zoom-in or Zoom out an object on the screen is called Transformations. There are two types of transformations in computer graphics. Geometric Transformations Coordinate Transformations Geometric Transformations – As the...
Read More

Numerical Examples of 2d Geometric Transformation- Translation

Problem Statement: An object is placed with respect to origin on (2,1). Now move the object away from the origin by 2 steps in x and 3 steps in y. What would be new coordinates to the moved object. S-1 : The old coordinates of the object are x=2 and y =1. Translation coordinate in...
Read More

Draw Line using Line Equation – Slope-Intercept Equation Algo

This method is the first method, even before any of other methods of line drawing like DDA , BLA were defined. The major drawback of this method is the fraction values it is, More the fraction values more would be approximation, more approximation means more loss of information. If the information loss is more then...
Read More

Numerical Examples of Bresenham’s Line Algo

Using Bresenham’s algorithm, generate the coordinates of the pixels that lie on a line segment having the endpoints (2, 3) and (5, 8). Case: When slope (m) > 1 Now let’s solve the same numerical using BLA Algorithm. S-1:  x1=2; y1=3; x2=5; y2=8. S-2: dy=y2-y1 8-3= 5 and dx = x2-x1 = 5-2 = 3...
Read More

Numerical of Mid Point Circle Algorithm

Example-1 Draw a circle using Midpoint Circle Algorithm having radius as 10 and center of circle (100,100). Important points: Starting d =5/4-r but as 5/4 is approximately equal to 1 so initial d would be d=1-r. Plotted one pixel will generate 7 other points, because of 8 way symmetry.  The Algorithm: S-1: Assume the coordinates...
Read More

Numerical of Bresenham’s Circle Algorithm

Numerical of Bresenham’s Circle Algorithm Bresenham’s Circle Algorithm Draw a circle using BCA having radius as 10 and center of circle (100,100). S-1; Enter the center h=100, k=100 and radius r=10. S-2: Find d=3-2*(10)= -17  and take x = 0 , y = 10 ; S-3: If (d>=0) then x = x +1 and y...
Read More

8-Way Symmetry & Bresenham’s Circle Algorithm

Circle The most important thing in drawing a circle is learning how the circle is drawn using 8-way symmetry. It is based on Mirror reflection. If we see Right hand in the mirror we will see Left hand, Similarly if we see pixel (x,y) in mirror we will see (y,x).  So point P1(x,y) will become...
Read More

Numerical of DDA Algorithm

Let us understand how DDA Algorithm works by taking some examples and solving them too. Just keep in mind two things one, Y=mx+b is the line equation. Second, If m is less than one increase X and calculate Y. If m is more than 1 then increase Y and calculate X. DDA Algorithm is explained...
Read More

We have disabled - Right- Click - How about stay to read :)