[vtkusers] Re: 3D object projected on a plane

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Nov 2 16:05:40 EST 2005


Monica Gemo wrote:
> Hello vtkers,
> I am not experienced with vtk and I need your help to calculate
> the 2D projection of a 3D object on a given plane .
> I tried to use vtkCutter and have an intersection of the 3D object on 
> the plane,
> this gives an approximation, but not the exact projection.
> 
> Is there an effective way to deal with this case in vtk?
> 
> Any suggestion is more than welcome!
> 
> Thanks a lot,
> Monica
> 
>  Monica Gemo - Ph.D. Student
Hi Monica,

Have a look at the ProjectPoint method in vtkPlane if you want to 
project the geometry.

If you want to get a  2d outline of your 3d object you can try this:

Set the renderer's view plane as the plane you want to project on to 
(set the active camera's position and focal point) then use this 
pipeline: vtkRenderWindow->vtkWindowToImageFilter->vtkContourFilter. You 
have to set the renderer's background colour to white, set the actor's 
colour to black, and use 127.5 as the contour value.


hth

Goodwin




More information about the vtkusers mailing list