
3D Bresenham's line generation 1.0 File ID: 86175 


 3D Bresenham's line generation 1.0 License: Shareware File Size: 10.0 KB Downloads: 15
Submit Rating: 



3D Bresenham's line generation 1.0 Description 

Description: 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: http://www.mathworks.com/matlabcentral/fil...?objectId=21080
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.
Example:
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. ftp://ftp.isc.org/pub/usenet/comp.sources...volume26/line3d Which is also referenced by:
Fischer, J., A. del Rio (2004). A Fast Method for Applying Rigid Transformations to Volume Data, WSCG2004 Conference. http://wscg.zcu.cz/wscg2004/Papers_2004_Short/M19.pdf
License: Shareware Related: digit, times, increase, default, nearest, rounded, means, output, Length O/S:BSD, Linux, Solaris, Mac OS X File Size: 10.0 KB Downloads: 15


More Similar Code 

This code uses Bresenham line generation algorithm to generate a line, with modified expression for error calculation which does not involves any division or calculation of slope of line. This parameter is however modified by same mechanism as original algorithm but with different value than actual Bresenham algorithm. This code is generalized in terms of order of input of first point followed by second point or vice versa. Also result is...
Given starting and ending points returns list of coordinates as per Bresenham's line algorithm. I wrote this a long time ago under Matlab 4.x I think. It works under Matlab 5.3 and 6.1. I have not reviewed the code since I wrote it.
This free Java applet lets you have an image rotate on your site in 3D. It takes a 2D image and spins it around it's X, Y, or Z axis as if it were a 3D image.
It's great for logos on a site, or for general pictures that you want to...
3D Affine matrix is such a 4x4 matrix:
M = [ [R T]; [0 0 0 1] ]; [x2 y2 z2 1]ddeOao = M * [x1 y1 z1 1]ddeOao ;
where, R is a 3x3 rotation matrix, and T is a 3x1 translation matrix. [x1 y1 z1] is a location in original...
This code does not use any for loops and takes advantage of Matlabs internally optimized routines to produce a fast, optimized version of Bresenham's line drawing algorithm
The Big Faceless Graph Library is a Java class library for creating graphs and charts. Backed by a full 3D engine, you can create shaded 3D Pie, Bar and Line graphs as GIF, PDF, PNG or other image formats. Features include transparent backgrounds,...
This Java class library is for creating graphs and charts. It is backed by a full 3D engine, allowing you to create shaded 3D pie, bar, and line graphs as GIF, PDF, PNG, or other image formats. Its features include transparent backgrounds,...
AJAX Progressbar Control is new AJAX based Progress bar for KUpload+ 2.0 which takes full advantage of AJAX and the new features of Microsoft's nextgeneration IDE  Visual Studio .NET 2005. It also allows developers to enjoy significant...
Released VB application will crash and the user do not know why! This tool adds line number on VB source files automatically. With its help and smartly using the undocumented VB function erl() , user can report error's line No now.
Given start and end point, produce a list of points through which line (or ray) will traverse. 
User Review for 3D Bresenham's line generation 
