vtkViewPort

Roland Schwarz roland.schwarz at telecom.at
Thu Sep 16 08:44:23 EDT 1999


Dear vtk Users,
    I need to derive a specialized class from vtkViewPort
and I have some questions about the coordinate transformations:

    There aparently are different sets of transformation functions
that serve a similar purpose. can anyone tell me if the function
'DisplayToView' is always expected to result in the same as
when the following sequence of functions is executed?

In other 'words' ...

Should the original implementation
===========================
void vtkViewport::DisplaytoView()
{
    float vx, vy, vz;
    int sizex, sizey;
    int *size;

    size = this->VTKWindow->GetSize();
    sizex = size[0];
    sizey = size[1];

    vx = 2.0 * (this->DisplayPoint[0] - sizex*this->Viewport[0])/
        (sizex*(this->Viewport[2]-this->Viewport[0])) - 1.0;
    vy = 2.0 * (this->Displaypoint[1] - sizey*this->viewport[1])/
        (sizey*(this->Viewport[3]-this->Viewport[1])) - 1.0;
    vz = thisDisplaypoint[2];

    this->setViewPoint(vx*this->Aspect[0], vy*thisAspect[1],vz);
}

be equivalent to
=============
void vtkViewport::DisplaytoView()
{
    float x, y, z;
    x = this->DisplayPoint[0];
    y = this->DisplayPoint[1];
    z = this->DisplayPoint[2];

    DisplayToNormalizedDisplay(x, y);
    NormalizedDisplayToViewport(x, y);
    ViewportToNormalizedViewport(x, y);
    NormalizedViewportToView(x, y, z); 

    this->SetViewPoint(x, y, z);
}

I suspect that they yield different results when ViewPort[0] and/or
ViewPort[1] != 0. Can anyone tell me the idea that is behind these
different implementations?

Thank you,

Roland Schwarz
Business Email: RSchwarz at riegl.co.at
Private Email: roland.schwarz at telecom.at



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list