[vtkusers] DisplayToWorld

Steve Woolsey woolsr at inel.gov
Mon Oct 30 19:07:37 EST 2000


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?

Thanks,

Steve
-------------------------------------------------------------------
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