# Tag Archives: computer-graphics

## Scan-line Polygon filling using OPENGL in C

Figures on a computer screen can be drawn using polygons. To fill those figures with color, we need to develop some algorithm.There are two famous… Read More »

## Anti-aliased Line | Xiaolin Wu’s algorithm

Anti-Aliased Line Drawing Below is the image showing line drawn with Bresenham’s line algorithm (left) and Xiaolin Wu’s line algorithm (right) which smooths the line.… Read More »

## 2D Transformation in Computer Graphics | Set 1 (Scaling of Objects)

A scaling transformation alters size of an object. In the scaling process, we either compress or expand the dimension of the object. Scaling operation can… Read More »

## How to add “graphics.h” C/C++ library to gcc compiler in Linux

While trying c graphic programming on Ubuntu, I figured out that graphic.h is not a standard C library and it is not supported by gcc… Read More »

## Draw a circle without floating point arithmetic

Given a radius of a circle, draw the circle without using floating point arithmetic. Following program uses a simple concept. Let the radius of the… Read More »

## Polygon Clipping | Sutherland–Hodgman Algorithm

A convex polygon and a convex clipping area are given. The task is to clip polygon edges using the Sutherland–Hodgman Algorithm. Input is in the… Read More »

## Point Clipping Algorithm in Computer Graphics

Clipping: In computer graphics our screen act as a 2-D coordinate system. it is not necessary that each and every point can be viewed on… Read More »

## Mid-Point Line Generation Algorithm

Given coordinate of two points A(x1, y1) and B(x2, y2) such that x1 < x2 and y1 < y2. The task to find all the… Read More »

## Bresenham’s Line Generation Algorithm

Given coordinate of two points A(x1, y1) and B(x2, y2). The task to find all the intermediate points required for drawing line AB on the… Read More »

## DDA Line generation Algorithm in Computer Graphics

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… Read More »

## Line Clipping | Set 1 (Cohen–Sutherland Algorithm)

Given a set of lines and a rectangular area of interest, the task is to remove lines which are outside the area of interest and… Read More »

## Creating a Rainbow using Graphics Programming in C

In Turbo C graphics we use graphics.h functions to draw different shapes(like circle, rectangle etc), display text(any message) in different format(different fonts and colors). By… Read More »

## Klee’s Algorithm (Length Of Union Of Segments of a line)

Given starting and ending positions of segments on a line, the task is to take the union of all given segments and find length covered… Read More »

## Implementation of a Falling Matrix

Since the dawn of computers, Hollywood has greatly demonstrated a Hacker or a Programmer as someone sitting on a computer typing random keys on computer… Read More »

## Code to generate the map of India (with explanation)

Given a obfuscated code that generates the map of India, explain its working. The following code when executed generates the map of India – #include… Read More »