[vtkusers] converting from display coordinates to world coodinates

megha agarwal megha_agar at yahoo.co.in
Tue Mar 9 03:41:29 EST 2004


Hello all
 
I am using the following code to convert the display coords to world coords 
 
  double *arr=cam->GetFocalPoint();
     x=iren->GetEventPosition()[0]; 
     y=iren->GetEventPosition()[1]; 
     z=arr[2];
 float display[3];
 display[0]=(float)x;
 display[1]=(float)y;
 display[2]=(float)z;
 ren->SetDisplayPoint(display);
 ren->DisplayToWorld();
 float *world;
 world=ren->GetWorldPoint();
 vol->SetPosition((double)world[0],(double)world[1],(double)world[2]);
 iren->Render();
 
but the world coords that i am getting is something like
  world[0]=2000.34;
  world[1]=95123.00
 world[2]= -2300.04
 
Please suggest a solution
Thanks
Megha

Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040309/95d50635/attachment.htm>


More information about the vtkusers mailing list