About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • Last update: 5 years ago
  • Total downloads: 126
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Jimmy Shen (5 other programs)
See full specifications

scripts default icon3D Bresenham's line generation (Scripts) Publisher's description

This program will generate the coordinates of a 3D Bresenham's raster line between two given points.

This program will generate the coordinates of a 3D Bresenham's raster line between two given points.

A very useful application of this algorithm can be found in the implementation of Fischer's Bresenham interpolation method in my another program that can rotate three dimensional image volume with an affine matrix:

Usage: [X Y Z] = bresenham_line3d(P1, P2);

P1 - vector for Point1, where P1 = [x1 y1 z1]

P2 - vector for Point2, where P2 = [x2 y2 z2]

precision (optional) - Although according to Bresenham's line algorithm, point coordinates x1 y1 z1 and x2 y2 z2 should be integer numbers, this program extends its limit to all real numbers. If any of them are floating numbers, you should specify how many digits of decimal that you would like to preserve. Be aware that the length of output X Y Z coordinates will increase in 10 times for each decimal digit that you want to preserve. By default, the precision is 0, which means that they will be rounded to the nearest integer.

X - a set of x coordinates on Bresenham's line

Y - a set of y coordinates on Bresenham's line

Z - a set of z coordinates on Bresenham's line

Therefore, all points in XYZ set (i.e. P(i) = [X(i) Y(i) Z(i)]) will constitute the Bresenham's line between P1 and P1.


P1 = [12 37 6]; P2 = [46 3 35];
[X Y Z] = bresenham_line3d(P1, P2);
figure; plot3(X,Y,Z,'s','markerface','b');

This program is ported to MATLAB from:

B.Pendleton. line3d - 3D Bresenham's (a 3D line drawing algorithm), 1992.
Which is also referenced by:

Fischer, J., A. del Rio (2004). A Fast Method for Applying Rigid Transformations to Volume Data, WSCG2004 Conference.

System Requirements:

MATLAB 5.2 (R10)
Program Release Status: New Release
Program Install Support: Install and Uninstall

3D Bresenham's line generation (Scripts) Tags:

Click on a tag to find related softwares

Is 3D Bresenham's line generation (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.