Commit b5e4dc79 authored by Ken Martin's avatar Ken Martin
Browse files

subpixel DPoint

parent 292b211a
......@@ -373,7 +373,7 @@ void vtkRenderer::DisplayToView()
// Convert view coordinates to display coordinates.
void vtkRenderer::ViewToDisplay()
{
int dx,dy;
float dx,dy;
int sizex,sizey;
int *size;
......@@ -382,12 +382,12 @@ void vtkRenderer::ViewToDisplay()
sizex = size[0];
sizey = size[1];
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) *
dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]);
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) *
sizex*this->Viewport[0];
dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]);
sizey*this->Viewport[1];
this->SetDisplayPoint(dx,dy,this->ViewPoint[2]);
}
......
......@@ -322,7 +322,7 @@ void vtkSbrRenderer::DisplayToView()
// Convert view coordinates to display coordinates.
void vtkSbrRenderer::ViewToDisplay()
{
int dx,dy;
float dx,dy;
int sizex,sizey;
int *size;
......@@ -338,34 +338,34 @@ void vtkSbrRenderer::ViewToDisplay()
{
case VTK_STEREO_CRYSTAL_EYES:
{
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]);
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]);
dy = (int)(dy/2.0);
dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0];
dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1];
dy = dy/2.0;
}
break;
default:
{
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]);
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]);
dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0];
dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1];
}
}
}
else
{
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]);
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]);
dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0];
dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1];
}
this->SetDisplayPoint(dx,dy,this->ViewPoint[2]);
......
Markdown is supported
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