Commit 4977f9cd authored by Aashish Chaudhary's avatar Aashish Chaudhary
Browse files

Removed deering frustum from transform

vtkCamera class implements it.

Change-Id: Ieb1ded48f74c732079a6133c1a8dd1c0c994d817
parent e09aca54
......@@ -323,45 +323,6 @@ void vtkPerspectiveTransform::Frustum(double xmin, double xmax,
this->Concatenate(*matrix);
}
void vtkPerspectiveTransform::DeeringFrustum(double xmin, double xmax,
double ymin, double ymax,
double F, double B,
double E[3])
{
const int x =0, y=1, z=2;
double L[2] = {xmin, ymin};
double H[2] = {xmax, ymax};
double matrix[4][4];
double width = H[x] - L[x];
double height = H[y] - L[y];
double depth = B - F;
matrix[0][0] = ( 2*E[z] )/width;
matrix[1][0] = 0;
matrix[2][0] = 0;
matrix[3][0] = 0;
matrix[0][1] = 0;
matrix[1][1] = ( 2*E[z] )/ height;
matrix[2][1] = 0;
matrix[3][1] = 0;
matrix[0][2] = ( H[x]+L[x] - 2*E[x] )/width;
matrix[1][2] = ( H[y]+L[y] - 2*E[y] )/height;
matrix[2][2] = ( B+F-2*E[z] )/depth;
matrix[3][2] = -1;
matrix[0][3] = ( -E[z]*( H[x]+L[x] ) )/width;
matrix[1][3] = ( -E[z]*( H[y]+L[y] ) )/height;
matrix[2][3] = B-E[z]- ( B *( B+F - 2*E[z] )/depth );
matrix[3][3] = E[z];
this->Concatenate(*matrix);
}
//----------------------------------------------------------------------------
// For convenience, an easy way to set up a symmetrical frustum.
void vtkPerspectiveTransform::Perspective(double angle, double aspect,
......
......@@ -101,18 +101,6 @@ class VTK_COMMON_EXPORT vtkPerspectiveTransform : public vtkHomogeneousTransform
void Frustum(double xmin, double xmax, double ymin, double ymax,
double znear, double zfar);
// Description:
// Create an deering perspective projection matrix and concatenate it by the
// current transformation. This is used for head tracking. So the position of
// the eye in the screen coordinate space should also be provided. The matrix
// maps a frustum with a back plane at -zfar and a front plane at -znear with
// extent if the window provided by [xmin,xmax],[ymin,ymax] to [-1,+1], [-1,+1], [+1,-1] incorporatin
// the posision of the eye given by eyePos[3] in screen (or window) coordinates.
void DeeringFrustum(double xmin, double xmax,
double ymin, double ymax,
double znear, double zfar,
double eyePos[3]);
// Description:
// Create a perspective projection matrix by specifying the view angle
// (this angle is in the y direction), the aspect ratio, and the near
......
......@@ -313,8 +313,8 @@ class VTK_RENDERING_EXPORT vtkCamera : public vtkObject
// Description:
// Set/Get eye transformation matrix.
// This is the transformation matrix for the point between eyes.
// Default is identity.
// This will be used only for deering frustum calculation.
// Default is identity.
void SetEyeTransformMatrix(vtkMatrix4x4* matrix);
vtkGetObjectMacro(EyeTransformMatrix, vtkMatrix4x4);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment