c-ray-tracer
This is my first attempt at writing a ray tracer and is done
with the C programming language. C was used because ray tracing
can be a CPU-intensive process and an efficient language is
needed. This program currently takes it's input in NFF format,
as provided by the
Standard Procedural Databases.
There are several improvements which I would make if I had
the time:
- Support for more objects. This currently supports
concave polygons, spheres and triangles, but cones and
convex polygons would be nice too.
- Support for more inputs. This currently only
supports input in NFF format, but could probably be
easily changed to using different input formats. I'm
not sure what the standard graphics input formats are,
so if somebody could give me recommendations of good
graphics description formats, please let me know.
- Fix to the refraction code. I haven't been able
to test this very well, but I have the feeling it
doesn't quite work.
- Support for different output formats. If this were
hooked up to the GD library, it could easily output
to .gif, .png, .jpg...
- Improvement in the math. Currently there are a
couple of places where I have to multiply vectors by
a negative. I don't know if this is a bug in my code
or in the NFF code being supplied, but there's definitely
a bug somewhere.
- Efficiency improvements. This could be sped up by
doing bounding boxes so that all the objects don't have
to be parsed, hooking it up to
POSIX pthreads and many other things I probably
haven't thought of.
Download: c-ray-tracer.tar.gz
Example Renderings: