Bad picking in parallel projection mode
Bill Lorensen
wlorens1 at nycap.rr.com
Thu Nov 11 17:51:47 EST 1999
Roberto,
Thanks for the bug report and fix. Your changes have been checked into the cvs repository.
Your report was timely. I needed to do picking today with a parallel projection. Your fix saved me mucho time,
Long live open source!!
Bill
At 11:58 AM 11/10/99 +0100, Roberto Gori wrote:
>Try with this patch.
>*** graphics/vtkPicker.org Wed Oct 6 12:14:21 1999
>--- graphics/vtkPicker.cxx Wed Oct 6 15:42:47 1999
>***************
>*** 242,255 ****
> }
>
> clipRange = camera->GetClippingRange();
>!
>! tF = clipRange[0] / rayLength;
>! tB = clipRange[1] / rayLength;
>! for (i=0; i<3; i++)
>! {
>! p1World[i] = cameraPos[i] + tF*ray[i];
>! p2World[i] = cameraPos[i] + tB*ray[i];
>! }
> p1World[3] = p2World[3] = 1.0;
>
> // Compute the tolerance in world coordinates. Do this by
>--- 242,265 ----
> }
>
> clipRange = camera->GetClippingRange();
>!
>! if ( camera->GetParallelProjection() ) {
>! tF = clipRange[0] - rayLength;
>! tB = clipRange[1] - rayLength;
>! for (i=0; i<3; i++)
>! {
>! p1World[i] = PickPosition[i] + tF*cameraDOP[i];
>! p2World[i] = PickPosition[i] + tB*cameraDOP[i];
>! }
>! } else {
>! tF = clipRange[0] / rayLength;
>! tB = clipRange[1] / rayLength;
>! for (i=0; i<3; i++)
>! {
>! p1World[i] = cameraPos[i] + tF*ray[i];
>! p2World[i] = cameraPos[i] + tB*ray[i];
>! }
>! }
> p1World[3] = p2World[3] = 1.0;
>
> // Compute the tolerance in world coordinates. Do this by
-----------------------------------------------------------------------------
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