Kind of weird that I am late for my first official post but it's been a busy weekend and I think I still have to get the habit of making weekly posts (first time ever having a blog = P).
![]() |
| Image generated using Ray Tracing |
As my first project on Ferlocar, I will be working on Ray Tracing :).
For those of you who are not familiarized with the term, this post will give you a brief description of what Ray Tracing means and the project that is ahead for me and any of you who's interested on making your own 3D Image Generation Tool from scratch.
Ray Tracing
What is it?
Ray Tracing is an algorithm that is used to generate three-dimensional images by tracing a ray through pixels in a plane.It is a very elegant technique that has many characteristics that should be taken into account before being used:
- Generates very realistic images.
- Provides a very consistent math of reality (you will see soon enough).
- It can be implemented relatively easy (the basic algorithm).
- Very helpful to generate shadows, mirrors, transparency, textures, etc.
- It is VERY slow, which is why it is not normally used on real time environments, such as video games. Still, many of the Pixar and Dreamworks movies are made with this powerful tool.
So... How does it works?
Most of the Ray Tracing realistic nature is based on perspective. To generate a Ray Tracing image there are three main components: the scene, the window and the eye. I will explain each of them as it will help us to understand better the overall explanation of the algorithm.
- Scene: Is conformed by all the objects that exist on the 3D world that will be represented on the image that is generated. This objects include spheres, cylinders, polygons, cones, etc. Basically any object that can be represented with an equation or mathematical model can be included as part of a ray tracing scene.
- Eye: It is a point on the 3D space from which the scene is seen. It gives an "anchor" from which rays emerge to pass through the window observe the scene. It gives perspective and the image will be different depending on the position of the eye.
- Window: It is the grid through which the rays emerging from the eye pass in order to see what's in the scene. It is with the window that each pixel's color on the image is determined.
I know all of this is confusing, but sometimes an image is better than a thousand words:
![]() |
| Ray Tracing algorithm |
In the case above, the "Camera" is the eye, from which all the "View Rays" emerge to observe the "Scene Objects". For each pixel on the generated image, a "View Ray" is shot from the "Camera" on the direction of the window (marked as "Image" above). The intersection of each "View Ray" with any object on the scene is the one that determines the color of the respective pixel. The color of the object will also vary according to the light sources (which will be discussed on a future post).
What you will be needing
In order to keep up with this project you will be needing:
- Good programming skills (I will not be explaining how to program in here, although if you have any doubts about what does an specific portion of the code does, I will be more than happy to answer any question)
- Basic physics and math knowledge (mostly about linear algebra). Still, I will try to explain the basic math and physics topics covered on each section of the Ray Tracing tool.
- C++ knowledge. I myself don't know how to program on C++ but I've done some C projects (including a basic Ray Tracer) and will try to learn C++ along the way.
Other details:
- I will be working on Windows operating system.
- Have not decided on the IDE but probably Netbeans or Visual Studio 2010
On next Saturday, I will be posting the overall description of the Ray Tracing algorithm on pseudo code and the C++ equivalent. Hope you enjoy it!
Regards!
Carlos Fernandez






5 comments:
Excelente Carlos ahí estaré siguiendo los posts
En todas Raúl pura vida, mucho es similar a lo que ya habíamos visto en CG, pero voy a ver si lo puedo pulir un poco más y hacerlo en C++
Que bueno esta el blog! Nosotros en lenguajes hicimos algunas figuras empleando ray-tracing en C++. Cualquier cosa podría pasarle el código para que se ahorre un poco de tiempo
OK suena bien! Tal vez no lo tome todo pero podría tomar pedazos del código. Qué tal si me lo envía por correo o pone aquí un post con un link para descargar el proyecto (para que otros también puedan accederlo)?
OK claro, cual es tu correo?
Post a Comment