////////////////////////////////////////////////////////////////////// // A simple Shaderlamps sample application // // Project Website : http://www.ShaderLamps.com // (or http://www.cs.unc.edu/~raskar/Shaderlamps/ ) // // Code by // Thomas Willwacher (TWill@rz-online.de) // Earlier versions has contributions from // Ramesh Raskar, Kok-lim Low, Remo Ziegler // // Based on Papers : // // Shader Lamps: Animating Real Objects with Image Based Illumination // Ramesh Raskar, Greg Welch, Kok-lim Low, Deepak Bandyopadhyay // Eurographics Rendering Workshop, London, June 2001 // // Cartoon Dioramas in Motion // Ramesh Raskar, Remo Ziegler, Thomas Willwacher // Int Symp on Non-photorealistic Animation and Rendering, Annecy, // France 2002 // /////////////////////////////////////////////////////////////////////// Quick manual for Shader Lamps: 1. Create 3D graphics model for a physical object (in this case a Beetle Car) and save in Wavefront .obj format (in this case 'beetle.obj') (We took pictures of the beetle and then used PhotoModelerPro to create the 3D geometric model. Then used 3DStudioMax to add texture and materials.) 2. Take some important pts on the object, such as window corner, wheel corner etc and find the 3D coordinates of those points in the 3D graphics model (You can use 3DStudioMax, 3DExploration geometry inspector) Save the sequence of 3D points in the 'points.dat' text file The chosen units do not matter (inches, cm, mm etc), but make sure that you will use the same .obj file and same coordinates during calibration and rendering. You need a minimum of 6 points to calibrate the projector. Typically 15 to 20 points are recommended. 3. Place the physical Beetle Car model on a table 4. Aim the projector approximately so that it covers the Beetle Car 5. Run this program on the computer attached to the projector 6. Execute calibration routine as described below use key 'q' to quit the application use 'c' to start (and escape) calibration mode ---------------- When in calibration mode, you can set the crosshair with the mouse (left click) or alternatively with keys h,j,k,l (small movement) You have to set the crosshair to several significant calibration points (stored in file points.dat) For example: If the first record in points.dat is the location of the upper left vertex of the front window of the (virtual) car model, you have to set the crosshair such,that the projector beams the crosshair exactly to this vertex on the real world object If you have set the crosshair right, press the right mouse button. The point correspondence is stored, and you can continue with the second point. (=second record in points.dat) You can skip a point with 's'. (This might be necessary as some points may be self-occluded by the object). If you have entered enough points, press 'f'. Then the projection and modelview matrices are computed and stored in the files "IntMat0.dat" and "ExtMat0.dat". Finally press 'c' to get back to the rendering application. ///////////////////////////////////////////////////////////////////////