Ray-tracing 3D application

Posted on Saturday, February 24 2007 @ 13:15 CET by Thomas De Maesschalck
Some guy decided to create a ray-tracing 3D application. He published pictures, video and source code on his website. It took him less than 48 hours to program this software.

Ray tracing is a technique to model the path taken by light by following rays of light as they interact with optical surfaces.
Ray-tracing works sort of like a camera in real life, but in reverse. With a camera (or your eyes, for that matter), rays of light from the environment enter the lens and hit the film/digital chip/meaty eye cells. Something magical happens where the light hits and we get an image!

With ray tracing, we start at each point on our "film" or image, and blast a ray out of our camera lens and see what it hits. What it hits determines the color and brightness at that spot on the film. Of course by "film" I mean digital image, and by "spot" I mean pixel.
I decided my entire program would be centered around one function, called raytrace(). The idea is this: You give raytrace() a starting point and a direction, and it follows that ray until it collides with something in my virtual environment. It returns the color of the object it collided with.
Check it out over here.


About the Author

Thomas De Maesschalck

Thomas has been messing with computer since early childhood and firmly believes the Internet is the best thing since sliced bread. Enjoys playing with new tech, is fascinated by science, and passionate about financial markets. When not behind a computer, he can be found with running shoes on or lifting heavy weights in the weight room.



Loading Comments