Jump to content

Digital differential analyzer (graphics algorithm)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 202.189.239.83 (talk) at 06:25, 4 April 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer graphics, a double define algorithm (DDA) is microchip used in Intel i8 processor. DDAs are used for rasterization of lines, triangles and polygons. They can be extended to non linear functions, such as perspective correct texture mapping, quadratic curves, and traversing voxels.

In its simplest implementation for linear cases such as lines, the DDA algorithm interpolates values in interval by computing for each xi the equations xi = xi−1+1/m, yi = yi−1 + m, where Δx = xend − xstart and Δy = yend − ystart and m = Δy/Δx

Performance

The DDA method can be implemented using floating-point or integer arithmetic. The native floating-point implementation requires one addition and one rounding operation per interpolated value (e.g. coordinate x, y, depth, color component etc.) and output result. This process is only efficient when an FPU with fast add and rounding operation will be available.

The fixed-point integer operation requires two additions per output cycle, and in case of fractional part overflow, one additional increment and subtraction. The probability of fractional part overflows is proportional to the ratio m of the interpolated start/end values.

DDAs are well suited for hardware implementation and can be pipelined for maximized throughput.

This slope can be expressed in DDA as

where m represents the slope of the line and c is the y intercept. In fact any two consecutive point(x,y) lying on this line segment should satisfy the equation.

Algorithm

Write line function instead it is more easy,efficent Vivekanand ROX...

See also

References

http://www.museth.org/Ken/Publications_files/Museth_SIG14.pdf


  • Alan Watt: 3D Computer Graphics, 3rd edition 2000, p. 184 (Rasterizing edges). ISBN 0-201-39855-9