TKTrace Raytracer version 0.001 Alpha 21/06 Copyright (C) 1993, Tom Kooij. June 21th, 1993. 1. Introduction TKTrace is a raytracer designed innitialy to explore the ins and outs of writing a raytracer. I've decided to release this program under the GNU public license to allow other people to start writing raytracers and/or testing new idea's. TKTrace is a 'free' program, please see the license agreement in "license.doc" (and "copying") for futher details. As stated in the license TKTrace you are allowed to use it without paying a registration fee to me first. I would, however, love to recieve your opinion on this raytracer. And if you signi- fically enhance it, I would like to see the results. Just a quick email telling how you are, what you do and what you think about TKTrace is enough. Postcards are also *very* appreciated. Have Fun! Tom Kooij, Schielaan 38b, 3043 HD Rotterdam, The Netherlands. tomk@interfhq.hacktic.nl Fidonet: 2:285/800.6 2:285/508.10 2. Things you should know before using TKTrace. - This raytracer is still under development. Al lot of features will have to be added. New primitives (polygons, cones etc) and things like solid texturing for example... - The shader is not complete either (no refraction etc). Coming up real soon. (Probably including some exciting idea's by Lex van der Sluijs, just wait and see!) - Antialiasing has not been implemented yet. (althought the -a option appears on the command-line.) - The parser is terrible. I know. If you can do a better job, please go ahead and make us all happy. 3. Using TKTrace This is were the real work starts. I haven't had the time to write this section *yet* (In fact, if I'd had the time, I would have used it to improve the raytracer, not the docs :-) ) 3.1 Coordinate System TKTrace uses the right-handed coordinate system; this means that the positive-x-axis points to the right, the positive-y-axis points into the screen and the positive-z-axis points upwards. 3.2 Scene description format The scene description was originally derived from the NFF-format by Eric Haines 3.2.1 Viewpoint viewpoint /* no particular order */ { from x y z /* look from */ at x y z /* look at */ up x y z /* up vector */ angle a /* view-angle */ aspect a /* aspect-ratio of image */ resolution x y /* resolution of image */ background r g b /* background color */ } 3.2.2 Lights light { x y z /* location */ r g b /* color (brightness) */ } 3.2.2 Surfaces surface { r g b /* ambient lighting */ r g b /* diffuse reflection */ r g b /* specular reflection */ s /* phong highlight */ } 3.2.3 Spheres sphere { x y z /* location */ r /* radius */ } 3.2.4 Planes plane { dx dy dz /* direction vector */ d /* distance from normal */ } 3.2.5 Quadrics quadric { a b c /* ax^2 + by^2 + cz^2 + */ d e f /* dxy + exz + fyz + */ g h i j /* gx + hy + iz + j = 0 */ } 3.2.6 Abbreviations background b light l plane p quadric q sphere s viewpoint v surface f 4. If you want to enhance TKTrace - Join the dutch fidonet 'FRACTAL.028' echo, if you can. - e-mail/netmail me. - try to obtain the latest version. I'll try to coordinate development. Please get in touch with me before you start hacking. 5. Credits & Bibliography TKTrace was modeled closely after the MTV-raytracer by Mark VandeWettering. The following books have been helpful during the development of TKTrace: An Introduction to Raytracing Edited by Andrew S. Glassner Academic Press 1989 Computer Graphics: Principles and Practice. 2nd Edition James D. Foley et al Addison-Wesley 1990 Photorealism and Ray Tracing in C Christopher D. Watkins et al M&T 1992