View Full Version : Raytracer

11th December 2009, 22:12

Last weeks, I asked some questions on the forum for my thesis about raytracing. Raytracing is a technique for rendering 3D scenes. Well, it's finally finshed! Thanks for the answers, it really helped me out.

(a scene rendered with our raytracer)

I used QT for threads, image handling, scripting and for the widgets of course ;-). You can download the thesis (in Dutch), the code and program (both in English) at http://code.google.com/p/pwsraytracer

I appreciate your feedbacks ;-)

17th December 2009, 13:15
Haven't compiled the code yet (still at worK) but I was just looking at your mesh.cpp file - I have an interest in any files with that name. In your constructor you are setting min and max X, Y, Z values for an 3d bounding box to zero. You might consider setting min values to +machine infinity and max values to -infinity (using your favourite macro) otherwise your algo will only work for meshes centred around the origin.


6th January 2010, 14:32
Sorry for my late reply, haven't checked the forum for a while :S

But every complex object (with a texture, a mesh) is created as a standard object. Centered around the orgin, radius 1 in case of a sphere and so on... Then you can transform the object to put it somewhere else in the world. The code in GeometricObject::hit then calculates what the orginal ray on the untransformerd object would be, and the calls the hit function.

Did you try to compile the code?