<div class="gmail_quote">On Tue, Feb 16, 2010 at 4:55 AM, Giancarlo Amati <span dir="ltr"><<a href="mailto:ilferraresebono@hotmail.it">ilferraresebono@hotmail.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Good morning Guys,<br><br>this is my question:<br><br>I have a dataset, and a projection matrix resulting from a calibration process. now:<br><br>the projection matrix P = 3x4 matrix. While transformation in VTK are 4x4 matrices.<br>
So, I transformed my P in a 4x4 by inserting a NULL row inbetween the 2nd and the 3rd row. this makes the Z null.<br><br>Now If I put this final P into a vtkTransform object and apply to my polydata, are the coordinates in the politdata divided automatically by that famous homogeneous coordinate factor W?<br>
<br>let's say that PD is my PolyData and I want to visualized the 2D by multiply P * PD where of course I get coordinate like (Xi,Yi, 0, Wi). But now I would like Xi/Wi which is a homogeneous normalization.... is it that automatic or I have to make it expiciltly?<br>
<br>Very kind regards.<br>Giancarlo <br>                                            </div><div><br></div></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote">Why would you insert a blank row as the 3rd row instead of the 4th? When you project the 3d points to 2d, you are expecting a 2-vector. The standard 3x4 projection matrix multiplied by a 3d point (in homogeneous coordinates, a 4-vector) will produce a 3-vector which you then have to divide by the 3rd coordinate to get your "pixel" (2-vector) coordinate. If you NULL the 4th row of the 4x4 matrix and multiply it by your 3d points (4-vectors after adding the homogeneous 1), you will get a 4-vector. You should just disregard the 4th coordinate - the first 3 coordinates will be the same as if you had just multiplied the first 3 rows (the 3x4 matrix you actually wanted) by your points.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">I'd recommend that we add a vtkMatrix3x4 class so this doesn't have to be done manually every time. The homogeneous division at the end would still be up to you, unless we added a vtkMatrix3x4::MultiplyHomogeneous function.</div>
<br clear="all">Hope that helps,<br><br>David</div>