home *** CD-ROM | disk | FTP | other *** search
- /*
- * ViewTransform.h - class definition general view transformation.
- *
- * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
- * University of Berne, Switzerland
- * All rights reserved.
- *
- * This software may be freely copied, modified, and redistributed
- * provided that this copyright notice is preserved on all copies.
- *
- * You may not distribute this software, in whole or in part, as part of
- * any commercial product without the express consent of the authors.
- *
- * There is no warranty or other guarantee of fitness of this software
- * for any purpose. It is provided solely "as is".
- *
- */
-
- #ifndef ViewTransform_H
- # define ViewTransform_H
-
- #include <iostream.h>
- #include "Vector.h"
- #include "TransMatrix.h"
- #include "BoundingBox.h"
-
- //___________________________________________________________ ViewTransform
-
- class ViewTransform
- {
- public:
- ViewTransform(const Vector&, const Vector&, const Vector&, real, int, int);
- ViewTransform(const BoundingBox&, const Vector&, real, int, int);
-
- Vector transformWorld2Screen(const Vector&);
- Vector transformWorld2View(const Vector&);
- Vector transformView2Screen(const Vector&);
-
- const Vector& getEye() const { return eye; }
- const Vector& getLookat() const { return lookat; }
- const Vector& getUp() const { return up; }
- real getFov() const { return fov; }
- int getResX() const { return resX; }
- int getResY() const { return resY; }
- const TransMatrix& getViewmat() const { return viewmat; }
-
- friend ostream& operator<<(ostream&, const ViewTransform&);
-
- private:
- void buildView();
-
- TransMatrix viewmat;
- Vector eye, lookat, up;
- real fov;
- int resX, resY;
- real widthOfViewplane;
- };
-
-
- #endif // ViewTransform_H
-