<div class="gmail_quote">On Sun, Jun 27, 2010 at 7:01 AM, Luca Penasa <span dir="ltr"><<a href="mailto:luca.penasa@email.it">luca.penasa@email.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
hi everybody,<br>
I have a cloud of points in 3D space. These points describe with some<br>
approximations a planar surface. I want to project every point on the<br>
best fitting plane, so to reduce my points in a 2D space.<br>
I used the vtkPlane.ProjectPoint function that works fine for the<br>
projection. after the projection i have for every point 3 spatial<br>
coordinates, that define points on the same plane.<br>
<br>
i would like to remap my points on a regular matrix (i.e. a classical<br>
image). Is there a way to do that in an efficent way??<br><br></blockquote><div class="gmail_quote"><br></div>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:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">1) Project the point onto both basis vectors</div><div class="gmail_quote">2) Find the distance of both projected points to the origin</div><div class="gmail_quote">
3) Round (or somehow "snap") these values onto an integer value. These are your "pixel coordinates" in the resulting image.</div><div class="gmail_quote"><br></div><div class="gmail_quote">I hope that helps.<br>
<br><div>David </div></div>