Skip to main content

Posts

Bresenham's Line Algorithm (THICK LINE)

Recent posts

Bresenham's Line Algorithm (DASHED LINE)

Bresenham's Line Algorithm (DASHED LINE) The Bresenham algorithm is an incremental scan conversion algorithm.

Bresenham's Line Algorithm (DOTTED LINE)

Bresenham's Line Algorithm (DOTTED LINE) Bresenham's Line Algorithm (DOTTED LINE) Bresenham's Line Algorithm (DOTTED LINE) The Bresenham algorithm is an incremental scan conversion algorithm.

Bresenham's Line Algorithm (SOLID LINE)

Bresenham's Line Algorithm (SOLID LINE) The Bresenham algorithm is an incremental scan conversion algorithm.

Cohen Sutherland Line Clipping Algorithm

Cohen Sutherland Line Clipping Algorithm The Cohen–Sutherland algorithm is a computer graphics algorithm used for line clipping. The algorithm divides a two-dimensional space into 9 regions and then efficiently determines the lines and portions of lines that are visible in the center region of interest (the viewport). We will use 4-bits to divide the entire region. These 4 bits represent the Top, Bottom, Right, and Left of the region as shown in the following figure. Here, the TOP and LEFT bit is set to 1 because it is the TOP-LEFT corner. Viewport Image Credits: Tutorials Point There are 3 possibilities for the line to lie  − Line can be completely inside the window (This line should be visible). Line can be completely outside the window (This line should be rejected). Line can be partially inside the window (We find intersection point and draw only that portion of the line which lies inside the region). Code: If you can't see the code, t

Rotation about an Arbitrary Point

Rotation about an Arbitrary Point In this program we will perform Rotation about an Arbitrary Point i.e. the shape which we will rotate won't move to different position instead it will be at a fixed position on a point. Here, first we translate the shape to Origin. Then rotate it about the given angle and translate it back to it's original position i.e. the fixed point. Translation:  Translation is defined as moving the object from one position to another position along straight line path. Rotation:  A rotation repositions all points in an object along a circular path in the plane centered at the pivot point. We rotate an object by an angle theta. New coordinates after rotation depend on both x and y • x’ = xcosθ -y sinθ • y’ = xsinθ+ ycosθ Code: If you can't see the code, then Enable JavaScript in you browser Output: Note:   Just copy the files " CGA.bgi " & " EGAVGA.bgi " from  bgi  folder to  bin . So, i

2D Transformation

2D Transformation The 2D transformations are: 1. Translation 2. Scaling 3. Rotation 4. Reflection 5. Shear



Bestseller's in Electronics only at Amazon Best Selling Products on Amazon