Code Directory
 Visual Basic & VB.NET
New Code
Vue Injector 3.3
Spectrum Analyzer pro Live 2019
Devart Excel Add-in for HubSpot 2.1
RentALLScript - Airbnb clone 2.2
SuiteCRM Theme Customization 7.11.6
iScripts NetMenus 3.1
iScripts EasyIndex 2.2
iScripts EasySnaps 2.0
Australia MyPost shipping For Magento 2 1.0.0
Australia Post eParcel For Magento 1.1.1
Source Control for SQL Server 2.0
Answers phpSoftPro 3.12
Exlcart 2.0
School College ERP 1.3.2
White-label Grocery Delivery App Solution 2.0
Top Code
iScripts EasySnaps 1
iScripts NetMenus 2.0
iScripts EasyIndex 1
ATN Site Builder 3.0
phpEnter 5.1.
IcrediBB Bulletin Board System 1.0
PHP MLM Software 2.0.1
GnuWin64 64
Deals and Discounts Website Script 1.0.2
Azizi search engine script PHP 4.1.10
Single Leg MLM 1.2.1
Eclipse Metrics plugin continued
Circle Fit (Taubin method) 1.0
Exlcart 2.0
OpenCV Delphi wrapper 1.0
Top Rated
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
3D Bresenham's line generation 1.0
File ID: 86175

3D Bresenham's line generation 1.0
Download 3D Bresenham's line generation 1.0http://www.mathworks.comReport Error Link
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:

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.

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]d-deOao = M * [x1 y1 z1 1]d-deOao ;

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 next-generation 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
- required fields

Please enter text on the image