home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / graphicgems4.lha / GemsIV / vec_mat / ray / Camera.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-06  |  1.4 KB  |  52 lines

  1. /************************************************************************
  2. *                                    *
  3. * CLASS: Camera                                *
  4. * AUTHOR: Jean-Francois DOUE                        *
  5. * LAST MODIFICATION: 12 Oct 1993                    *
  6. *                                    *
  7. * This class implements a simple model of 3D camera. The camera can    *
  8. * be positioned and rotated arbitrarily in space. Its focal length is    *
  9. * always equal to 1.                            *
  10. * This camera is a simplified version of the model proposed by        *
  11. * Foley, Van Dam, Feiner, Hughes in "Computer Graphics, Principles and    *
  12. * Practice". The following diagram shows what conventions are used:    *
  13. *                                    *
  14. *                                    *
  15. *             y                            *
  16. *        x    |    ^                        *
  17. *         \   |    |                        *
  18. *          \  |    | y film_size      target object            *
  19. *           \ |    |             ____            *
  20. *            \|    |            /     \            *
  21. * z <----+-----------|    v            |     |            *
  22. *     <---- 1 ---->                \____/            *
  23. *      focal        position                        *
  24. *   point (PRP)         (VRP)                        *
  25. *                                    *
  26. * The field of view of the camera can be easily specified by passing    *
  27. * the camera opening angles along the x and y axes (in degree). This    *
  28. * system is similar to the one used in Renderman.            *
  29. *                                    *
  30. ************************************************************************/
  31.  
  32. #ifndef Camera_h
  33. #define Camera_h 1
  34. #include "Object3D.h"
  35.  
  36. class Camera: public Object3D
  37. {
  38. protected:
  39.  vec2    film_size;
  40.  
  41. public:
  42.  
  43.  void setFieldOfView(vec2& v);
  44.  vec2 fieldOfView();
  45.  vec3 pointToRay(vec2&    p);
  46.  
  47.  // friends
  48.  friend istream& operator >> (istream& s, Camera& a);
  49. };
  50.  
  51. #endif
  52.