[vtkusers] Projecting points on a plane for obtain an image

David Doria daviddoria+vtk at gmail.com
Sun Jun 27 07:45:39 EDT 2010


On Sun, Jun 27, 2010 at 7:01 AM, Luca Penasa <luca.penasa at email.it> wrote:

> hi everybody,
>        I have a cloud of points in 3D space. These points describe with
> some
> approximations a planar surface. I want to project every point on the
> best fitting plane, so to reduce my points in a 2D space.
> I used the vtkPlane.ProjectPoint function that works fine for the
> projection. after the projection i have for every point 3 spatial
> coordinates, that define points on the same plane.
>
> i would like to remap my points on a regular matrix (i.e. a classical
> image). Is there a way to do that in an efficent way??
>
>
You will have to define a "basis" of your image. To do this, simply pick a
point (the origin) and two orthogonal vectors in your plane. Then for each
point in your point set:

1) Project the point onto both basis vectors
2) Find the distance of both projected points to the origin
3) Round (or somehow "snap") these values onto an integer value. These are
your "pixel coordinates" in the resulting image.

I hope that helps.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100627/44ac46d2/attachment.htm>


More information about the vtkusers mailing list