Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r756 - in trunk: Interface Model/Cameras
- Date: Fri, 9 Dec 2005 00:41:11 -0700 (MST)
Author: abe
Date: Fri Dec 9 00:41:10 2005
New Revision: 756
Modified:
trunk/Interface/Camera.h
trunk/Model/Cameras/EnvironmentCamera.cc
trunk/Model/Cameras/EnvironmentCamera.h
trunk/Model/Cameras/FisheyeCamera.cc
trunk/Model/Cameras/FisheyeCamera.h
trunk/Model/Cameras/OrthogonalCamera.cc
trunk/Model/Cameras/OrthogonalCamera.h
trunk/Model/Cameras/PinholeCamera.cc
trunk/Model/Cameras/PinholeCamera.h
Log:
Removed project(...) method from cameras. It is used in a different branch
and was only implemented in the pinhole camera.
M Interface/Camera.h
M Model/Cameras/EnvironmentCamera.cc
M Model/Cameras/EnvironmentCamera.h
M Model/Cameras/FisheyeCamera.cc
M Model/Cameras/OrthogonalCamera.cc
M Model/Cameras/FisheyeCamera.h
M Model/Cameras/OrthogonalCamera.h
M Model/Cameras/PinholeCamera.cc
M Model/Cameras/PinholeCamera.h
Modified: trunk/Interface/Camera.h
==============================================================================
--- trunk/Interface/Camera.h (original)
+++ trunk/Interface/Camera.h Fri Dec 9 00:41:10 2005
@@ -31,8 +31,6 @@
// Reset the camera.
virtual void reset( const Point &eye_, const Vector &up_, const Point
&lookat_ ) = 0;
- virtual Point project(const Point &point) const = 0; // project the 3D
point on to the camera image plane
-
enum TransformCenter {
LookAt,
Eye,
Modified: trunk/Model/Cameras/EnvironmentCamera.cc
==============================================================================
--- trunk/Model/Cameras/EnvironmentCamera.cc (original)
+++ trunk/Model/Cameras/EnvironmentCamera.cc Fri Dec 9 00:41:10 2005
@@ -173,12 +173,6 @@
// This functionality doesn't make much sense with the environment camera
}
-Point EnvironmentCamera::project(const Point& /*point*/) const
-{
- // NOT FINISHED
- return Point(0, 0, 0);
-}
-
void EnvironmentCamera::output( std::ostream &os ) {
os << "environment( -eye " << eye
Modified: trunk/Model/Cameras/EnvironmentCamera.h
==============================================================================
--- trunk/Model/Cameras/EnvironmentCamera.h (original)
+++ trunk/Model/Cameras/EnvironmentCamera.h Fri Dec 9 00:41:10 2005
@@ -27,7 +27,6 @@
virtual void dolly(Real);
virtual void transform(AffineTransform t, TransformCenter);
virtual void autoview(const BBox bbox);
- virtual Point project(const Point &point) const; // project a 3D point
to the camera image plane
static Camera* create(const vector<string>& args);
Modified: trunk/Model/Cameras/FisheyeCamera.cc
==============================================================================
--- trunk/Model/Cameras/FisheyeCamera.cc (original)
+++ trunk/Model/Cameras/FisheyeCamera.cc Fri Dec 9 00:41:10 2005
@@ -173,9 +173,5 @@
<< std::endl;
}
-Point FisheyeCamera::project(const Point& /*point*/) const
-{
- // NOT FINISHED
- return Point(0,0,0); // just a placeholder
-}
+
Modified: trunk/Model/Cameras/FisheyeCamera.h
==============================================================================
--- trunk/Model/Cameras/FisheyeCamera.h (original)
+++ trunk/Model/Cameras/FisheyeCamera.h Fri Dec 9 00:41:10 2005
@@ -35,7 +35,6 @@
virtual void transform(AffineTransform t, TransformCenter);
virtual void autoview(const BBox bbox);
virtual void output( std::ostream &os );
- virtual Point project(const Point &point) const; // project a 3D point
to the camera image plane
static Camera* create(const vector<string>& args);
virtual Point getPosition() const { return eye; }
Modified: trunk/Model/Cameras/OrthogonalCamera.cc
==============================================================================
--- trunk/Model/Cameras/OrthogonalCamera.cc (original)
+++ trunk/Model/Cameras/OrthogonalCamera.cc Fri Dec 9 00:41:10 2005
@@ -164,8 +164,3 @@
<< std::endl;
}
-Point OrthogonalCamera::project(const Point& /*point*/) const
-{
- // NOT FINISHED
- return Point(0,0,0); // just a placeholder
-}
Modified: trunk/Model/Cameras/OrthogonalCamera.h
==============================================================================
--- trunk/Model/Cameras/OrthogonalCamera.h (original)
+++ trunk/Model/Cameras/OrthogonalCamera.h Fri Dec 9 00:41:10 2005
@@ -26,7 +26,6 @@
virtual void transform(AffineTransform t, TransformCenter);
virtual void autoview(const BBox bbox);
virtual void output( std::ostream &os );
- virtual Point project(const Point &point) const;
static Camera* create(const vector<string>& args);
virtual Point getPosition() const { return eye; }
Modified: trunk/Model/Cameras/PinholeCamera.cc
==============================================================================
--- trunk/Model/Cameras/PinholeCamera.cc (original)
+++ trunk/Model/Cameras/PinholeCamera.cc Fri Dec 9 00:41:10 2005
@@ -104,47 +104,11 @@
u=Cross(v, direction);
u.normalize();
- for(i=0; i<4; i++)
- for(j=0; j<4; j++)
- proj[i][j] = mv[i][j] = 0.0;
-
- // form modelview matrix
- mv[0][0] = v.x(); mv[0][1] = v.y(); mv[0][2] = v.z();
- mv[0][3] = (-eye.x()*v.x()) + (-eye.y()*v.y()) + (-eye.z()*v.z());
- mv[1][0] = u.x(); mv[1][1] = u.y(); mv[1][2] = u.z();
- mv[1][3] = (-eye.x()*u.x()) + (-eye.y()*u.y()) + (-eye.z()*u.z());
- mv[2][0] = -1.0*n.x(); mv[2][1] = -1.0*n.y(); mv[2][2] = -1.0*n.z();
- mv[2][3] = (eye.x()*n.x()) + (eye.y()*n.y()) + (eye.z()*n.z());
- mv[3][3]= 1.0;
-
height=nearZ*tan(vfov*(Real)(0.5*M_PI/180.0));
u*=height;
width=nearZ*tan(hfov*(Real)(0.5*M_PI/180.0));
v*=width;
- // form projection matrix
- double f = 1.0/tan((vfov*M_PI/180.0)/2.0);
- double aspect = width/height;
- double farZ = nearZ*1000.0;
-
-
- proj[0][0] = f/aspect;
- proj[1][1] = f;
- proj[2][2] = (farZ+nearZ)/(nearZ-farZ);
- proj[2][3] = (2.0*farZ*nearZ)/(nearZ-farZ);
- proj[3][2] = -1.0;
-
- // product of two
- for(i=0; i<4; i++)
- {
- for(j=0; j<4; j++)
- {
- prodMat[i][j] = 0.0;
- for(k=0; k<4; k++)
- {
- prodMat[i][j] += proj[i][k]*mv[k][j];
- }
- }
- }
+
}
void PinholeCamera::makeRays(RayPacket& rays) const
@@ -250,14 +214,3 @@
setup();
}
-Point PinholeCamera::project(const Point &point) const
-{
- Point p2(prodMat[0][0]*point.x() + prodMat[0][1]*point.y() +
prodMat[0][2]*point.z() + prodMat[0][3],
- prodMat[1][0]*point.x() + prodMat[1][1]*point.y() +
prodMat[1][2]*point.z() + prodMat[1][3],
- prodMat[2][0]*point.x() + prodMat[2][1]*point.y() +
prodMat[2][2]*point.z() + prodMat[2][3]);
- double zval = prodMat[3][0]*point.x() + prodMat[3][1]*point.y() +
prodMat[3][2]*point.z() + prodMat[3][3];
-
- return Point(((p2.x()/zval)+1.0)/2.0,
- ((p2.y()/zval)+1.0)/2.0,
- ((p2.z()/zval)+1.0)/2.0);
-}
Modified: trunk/Model/Cameras/PinholeCamera.h
==============================================================================
--- trunk/Model/Cameras/PinholeCamera.h (original)
+++ trunk/Model/Cameras/PinholeCamera.h Fri Dec 9 00:41:10 2005
@@ -26,7 +26,6 @@
virtual void dolly(Real);
virtual void transform(AffineTransform t, TransformCenter);
virtual void autoview(const BBox bbox);
- virtual Point project(const Point &point) const; // project a 3D point
to the camera image plane
virtual void output( std::ostream &os );
static Camera* create(const vector<string>& args);
@@ -37,9 +36,13 @@
virtual void reset( const Point &eye_, const Vector &up_, const Point
&lookat_ ) {
eye = eye_; up = up_; lookat = lookat_; setup(); };
-
+
+ void setStereoOffset( Real stereo_offset_ ) { stereo_offset =
stereo_offset_; }
+ Real getStereoOffset() const { return stereo_offset; }
+
private:
void setup();
+
Point eye;
Point lookat;
Vector up;
- [MANTA] r756 - in trunk: Interface Model/Cameras, abe, 12/09/2005
Archive powered by MHonArc 2.6.16.