[vtkusers] DisplayToWorld

Steve Woolsey woolsr at inel.gov
Tue Oct 31 13:48:53 EST 2000


Thanks for the reply.  However, that wasn't the problem.  I found the
answer though it doesn't make much sense to me.  The values I needed are
returning in the z component from GetWorldPoint.

Edi wrote:
> 
> Maybe the Y axes in your GUI is inversed, from  what VTK knows.
> In C++ Builder , you have to shift on y:
> 
> ->Pick( X,  RenderWindow->Height-Y,... )
> 
> ----- Original Message -----
> From: "Steve Woolsey" <woolsr at inel.gov>
> To: "VTK Users" <vtkusers at public.kitware.com>
> Sent: Monday, October 30, 2000 4:07 PM
> Subject: [vtkusers] DisplayToWorld
> 
> > I am getting bad results for Y converting from Display coords to World
> > coords.
> >
> > I do the following:
> >
> > float startpt[4], endpt[4];
> >
> > int s[2];
> >
> > iren2->GetEventPosition(s);
> > renderer2->SetDisplayPoint(s[0], S[1], 0);
> > renderer2->DisplayToWorld();
> > renderer2->GetWorldPoint(startpt);
> > ...
> > int e[2];
> > iren2->GetEventPosition(e);
> > renderer2->SetDisplayPoint(e[0], e[1], 0);
> > renderer2->DisplayToWorld();
> > renderer2->getWorldPoint(endpt);
> >
> >
> > As an example, say that s = {298, 285} and e = {330, 264}.
> > In this case, when I do the print out, spartpt = {240060, -275676}, and
> > endpt = {296779, -275676}
> > Notice that the Y value is identical for both conversions.  I have tried
> > swapping the s[1] and 0, and e[1] with 0 in the SetDisplayPoint calls,
> > but with no success.  Anybody know what is wrong here?  Is there any
> > other way to convert the coords?

-- 
-------------------------------------------------------------------
Steven Woolsey                         Engineer/Scientist
Bechtel BWXT Idaho, LLC                Visualization Engineer
Idaho National Engineering Lab.        EMAIL: woolsr at inel.gov
P.O. Box 1625, M.S. 3605
Idaho Falls, ID  83415-3605
-------------------------------------------------------------------




More information about the vtkusers mailing list