[vtkusers] Pick 2 points at the same time

su yong sdsuys at hotmail.com
Wed Sep 4 22:11:46 EDT 2002


I have picked one point from the sphere .
I want to pick two points at the same time .I means to show two different 
colors' small balls as the two picked points at the same time.
How to do it?

the code is:

  vtkPointPicker *picker = vtkPointPicker::New();
    picker->SetTolerance(0.01);
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);
    iren->SetPicker(picker);
    iren->SetEndPickMethod(PickCells,(void *)iren);
    iren->Start();
.......
static void PickCells(void *arg)
{
  vtkRenderWindowInteractor *iren = (vtkRenderWindowInteractor *)arg;
  vtkPointPicker *picker = (vtkPointPicker *)iren->GetPicker();
 
 sphereActor->SetPosition(picker->GetPickPosition());
  renWin->Render();
}

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: 
http://messenger.microsoft.com/cn/




More information about the vtkusers mailing list