Code covered by the BSD License  

Highlights from
Ray/box Intersection

4.0

4.0 | 3 ratings Rate this file 16 Downloads (last 30 days) File Size: 29.57 KB File ID: #26834
image thumbnail

Ray/box Intersection

by Jesús P. Mena-Chalco

 

03 Mar 2010

Ray/box intersection using Smits' algorithm. The zip file includes one example of intersection.

| Watch this File

File Information
Description

Ray/box intersection using Smits' algorithm

The zip file includes one example of intersection.

Author:
    Jesús Mena

References:
[1] "Efficiency issues for ray tracing".
    B. Smits.
    Journal of Graphics Tools, 3(2):1–14, 1998.

[2] "An efficient and robust ray-box intersection algorithm"
    A. Williams, S. Barrus, and R.K. Morley and P. Shirley.
    Journal of Graphics, GPU, & Game Tools, 10(1):45-60, 2005.

[3] Other algorithms:
    http://www.realtimerendering.com/intersections.html

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Ray/Triangle Intersection
This submission has inspired the following:
A fast voxel traversal algorithm for ray tracing

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
12 Nov 2010 Matt K

There apears some errors exists. The scaling of the direction vector affects distances returned and even when I force a normalized vector, I have done test cases where the tmin distance from orgin is incorrect. I do appreciate the code, though, just want to pass along what I have found.

23 Jun 2011 HARI KRISHNAN  
09 Sep 2011 Chandrakumar  
22 Feb 2012 Deepak

Hi,

I am using the ray box intersection m.file posted by Jesús P. Mena-Chalco.

In his test case, if i replace the point of origin from outside the cube to within it, the point of intersection of the ray with the box is exactly opposite from the direction of the quiver. Is there a reason why this is doing it ?

I reversed the direction of the quiver and it passes through the point of intersection. It not a perfect way to do without knowing what part of the code controls the direction of the quiver..

Any help ?

Thanks

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
ray Jesús P. Mena-Chalco 04 Mar 2010 10:28:01
box Jesús P. Mena-Chalco 04 Mar 2010 10:28:01
intersection Jesús P. Mena-Chalco 04 Mar 2010 10:28:01
ray tracing Jesús P. Mena-Chalco 04 Mar 2010 10:28:01
render Jesús P. Mena-Chalco 04 Mar 2010 10:28:01
computer graphics Jesús P. Mena-Chalco 04 Mar 2010 10:28:01

Contact us at files@mathworks.com