File Exchange

image thumbnail


version (358 KB) by Nikolay Chumerin
Simple ray-tracing engine for Matlab.


Updated 11 May 2016

View License

The proposed raytracer allows to create simple synthetic scenes and render them from different camera positions. Some properties of the objects (position, orientation, size) can be defined as constants or as functions of time. The actual engine supports texture mapping and antialiasing (shadows, reflections and refractions are not supported yet).
The raytracer might be useful for researchers working in the computer vision domain, because it not only renders images but also can compute ray hit point's absolute and relative (wrt objects) positions and indices (which face of which object has been hit). This feature allows estimation of disparity (horizontal and vertical) map and motion field.
Few videos, demonstrating some properties of the raytracer can be found on my web-site:

Cite As

Nikolay Chumerin (2020). raytracer (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

peng wang

Yi Tian

i need to know if i can use this cod to modelate a ray trace of a parabolic trough solar collector

Yong Da

i want to do ray tracing in tumer texure using near field infrared. how can i find the the depth or volume of the tumeor


Thank you for this very nice work, But I want to ask whether you have new ray tracer which support the relfection, the refraction and the shadows.


Brilliant! Thank you for your work!

Updated tags.


Fixed URL to myRaytracer webpage.

- myRatracer works in Octave (haven't checked this before, but now it's true).
- fixed a nasty bug in disparity estimation (thanks to Jan Sochman).
- added a demo script raytracer_demo5.m demonstrating the correctness of the disparity maps.

description updated (added link to demo videos).

Added function showimage.m which shows an image even if the Image Processing Toolbox is not available (thanks to Chuck Rino).

added missed m-file rotation_matrix_3d.m (thanks to Christian Bouville)

Updated tags.

Added a link to demo videos.

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux