[vtkusers] WorldToDisplay coordinate conversion
James A Galbraith/GALBJA/CC01/INEEL/US
GALBJA at inel.gov
Wed Aug 15 13:23:24 EDT 2001
I guess I'm a little confused as too what vtkRenderer->WorldToDisplay() is
supposed to do. I hope someone can show me the light.
I have some terrain I have rendered in vtk. I am taking the world
coordinates of one of the corners (which is really close to the upper left
hand corner of the window) and trying to convert it to actual display
coordinates. My window size is returned as 483x383. The Display
coordinates I get back from WorldToDisplay is something like 251, 178,
1.99. When I pan around and actually move the corner in question out of
the window and do another WorldToDisplay, I get the same coordinates back.
A similar thing happens when I zoom in (using Camera->dolly), except the z
value changes minutely. If I rotate this thing about 90 degrees about the
x axis I get something like 233, -5624, 1.99. Is WorldToDisplay supposed
to give me actual window/screen coordinates or is it returning something
else.
My terrain is rendered in actual world coordinates and my camera has been
rotated around and positioned directly above the area of terrain rendered.
In the case I am describing, the terrain in question is on the back side of
the world, so the camera is rotated around 127 and up 36 degrees.
I would like something that would give me the actual screen/window
coordinates of a given world coordinate, or some indication of whether the
point is outside the window.
I Hope someone can straighten me out. I am running Windowz NT 4.0 using
the Java bindings.
Thanks
James Galbraith
galbja at inel.gov
More information about the vtkusers
mailing list