Attached Files | VTK-20080821-pick.patch [^] (1,784 bytes) 2008-08-25 05:51 [Show Content] [Hide Content]diff -u -r VTK-20080821-old/Rendering/vtkPicker.cxx VTK-20080821/Rendering/vtkPicker.cxx
--- VTK-20080821-old/Rendering/vtkPicker.cxx 2008-03-07 18:11:56.000000000 +0000
+++ VTK-20080821/Rendering/vtkPicker.cxx 2008-08-24 20:13:31.000000000 +0100
@@ -412,16 +412,16 @@
{
if (bounds[2*i] == bounds[2*i+1] && p2Mapper[i] != p1Mapper[i])
{
- t = (p2World[i] - bounds[2*i])/(p2Mapper[i] - p1Mapper[i]);
+ t = (p2Mapper[i] - bounds[2*i])/(p2Mapper[i] - p1Mapper[i]);
break;
}
}
if (t < VTK_DOUBLE_MAX)
{
- hitPosition[0] = (1.0 - t)*p1Mapper[0] + t*p2Mapper[0];
- hitPosition[1] = (1.0 - t)*p1Mapper[1] + t*p2Mapper[1];
- hitPosition[2] = (1.0 - t)*p1Mapper[2] + t*p2Mapper[2];
+ hitPosition[0] = t*p1Mapper[0] + (1.0 - t)*p2Mapper[0];
+ hitPosition[1] = t*p1Mapper[1] + (1.0 - t)*p2Mapper[1];
+ hitPosition[2] = t*p1Mapper[2] + (1.0 - t)*p2Mapper[2];
if ((bounds[0] == bounds[1] || (hitPosition[0] >= bounds[0]-tol &&
hitPosition[0] <= bounds[1]+tol)) &&
(bounds[2] == bounds[3] || (hitPosition[1] >= bounds[2]-tol &&
@@ -443,9 +443,9 @@
this->Prop3Ds->AddItem(imageActor);
this->PickedPositions->InsertNextPoint
- ((1.0 - t)*p1World[0] + t*p2World[0],
- (1.0 - t)*p1World[1] + t*p2World[1],
- (1.0 - t)*p1World[2] + t*p2World[2]);
+ (t*p1World[0] + (1.0 - t)*p2World[0],
+ t*p1World[1] + (1.0 - t)*p2World[1],
+ t*p1World[2] + (1.0 - t)*p2World[2]);
}
}
}//if visible and pickable not transparent and has mapper
|