Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.9 KiB

  1. ABOUT THIS PROGRAM:
  2. Backtrace is an OpenGL program meant to simulate ray tracing.
  3. It displays a refractive sphere above a plane. The sphere is lit by
  4. red, green, and blue spotlights which may be manually moved. The
  5. shadow of the sphere and the light which is refracted through the
  6. sphere are projected onto the plane.
  7. The "Material" menu controls the refractiveness of the sphere.
  8. The "Draw" menu controls which subparts of the scene are
  9. drawn. By default, the "Draw Texture" option is off. Texture mapping
  10. is slow on many systems and the texture map is completely gratuitous.
  11. However, you may want to turn texture mapping on once to see if the
  12. performance is acceptable on your system.
  13. The "Subdivision" menu controls the number of subdivisions
  14. used to draw the plane, the sphere, the lights, the shadows, and the
  15. refractions. More subdivisions will look better, but will be slower.
  16. The "Lights" menu can be used to turn the lights on and off on
  17. an individual basis. The "Reset Lights" button moves all the lights
  18. back to their original positions.
  19. The "Quick Motion" option under the option menu makes motions
  20. in r and phi (controlled by the middle and right mouse buttons,
  21. respectively) happen much more quickly by delaying recompuation of the
  22. shadows and refraction until the mouse button is released. The
  23. "Rotate Automatically" toggle causes the lights to rotate about the z
  24. axis at random speeds.
  25. Moving of the lights is accomplished with the mouse. The
  26. author wishes to apologize for the horribly awkward interface. To
  27. move a light, move the pointer over it and press one of the mouse
  28. buttons down. Draw the mouse to move the light. It is easiest to
  29. imagine the lights in spherical coordinates. The left mouse button
  30. controls rotation in theta (about the z axis). Moving the mouse
  31. horizontally while holding down the left mouse button will increase or
  32. decrease theta.
  33. The middle mouse button controls the radius, or the distance
  34. of the light from the sphere. Dragging the mouse toward the center of
  35. the screen decreases the distance of the light from the sphere, while
  36. moving away from the center of the screen increases the distance.
  37. The right mouse button controls rotation in phi, which can be
  38. thought of as the elevation of the light. Moving the mouse
  39. horizontally will change the elevation.
  40. TO COMPILE:
  41. Type "make." Note that you must have a C++ compiler
  42. installed. There may be a warning or two, but these should not cause
  43. problems. You must first have compiled libtk.a. You must also have
  44. a development copy of Motif and the Motif GL widget installed.
  45. OTHER MAKEFILE TARGETS:
  46. "make clean" removes objects, ~ files, and core files.
  47. "make clobber" also removes the executable.
  48. KNOWN BUGS:
  49. It's possible to change the phi of a light in such a way that
  50. the light gets below the sphere, which leads to unexpected (and
  51. inaccurate) results.
  52. AUTHOR:
  53. Celeste Fowler