- Joined
- Jun 26, 2009
- Messages
- 1,045
- Reaction score
- 0
- Points
- 36
Wow, I haven't been here for ages! I don't want to look at how long ago it was that I last posted...
Anyway, I thought I'd share a neat little thing I made in C++ - a ray tracer. A ray tracer is a program which creates a picture purely using mathematical algorithms for reflection and refraction. You specify the location and properties of your objects, feed them in, and for each pixel in the picture, the program shoots a ray out into the scene, determines what it hits, and colours the pixel according to that. It takes a while to render a frame, but the results are fantastic. I've attached a pic from my (basic) ray tracer.
It shows a pyramid of 14 spheres, all are metal apart from the top one which is glass with a (low) refractive index of 1.04, and the yellow one behind the top sphere, which is made of plastic. It took 75 seconds to render on my computer.
Because of their mathematical nature, ray tracers can only handle primitive objects like spheres and planes (the only two objects mine can render). However, it's possible to build complex meshes using individual triangles.
Anyway, nice to be back, hope I stick around!!
Anyway, I thought I'd share a neat little thing I made in C++ - a ray tracer. A ray tracer is a program which creates a picture purely using mathematical algorithms for reflection and refraction. You specify the location and properties of your objects, feed them in, and for each pixel in the picture, the program shoots a ray out into the scene, determines what it hits, and colours the pixel according to that. It takes a while to render a frame, but the results are fantastic. I've attached a pic from my (basic) ray tracer.
It shows a pyramid of 14 spheres, all are metal apart from the top one which is glass with a (low) refractive index of 1.04, and the yellow one behind the top sphere, which is made of plastic. It took 75 seconds to render on my computer.
Because of their mathematical nature, ray tracers can only handle primitive objects like spheres and planes (the only two objects mine can render). However, it's possible to build complex meshes using individual triangles.
Anyway, nice to be back, hope I stick around!!