David, <br><br>So the conversion depends upon what this 3x3 represents...if it is 3x3 with homogeneous coordinate then it wont be like you described in 2). If this matrix is a part of 4x4 (so in general 3x3 is representing transformation such as rotation and scaling) then yes 2) would work. Also if this 3x3 has w != 1 then there may or may not be a need of dividing the 4x4 components by this. <br>
<br>~ my 2 cents. <br><br><br><div class="gmail_quote">On Sun, Jan 10, 2010 at 1:36 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Sun, Jan 10, 2010 at 1:14 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
> Is this a hypothetical question or do you have a specific need? You<br>
> can always extract a 4x4 and create your own 3x3 in your application.<br>
> vtk does not have a vtkMatrix3x3.<br>
><br>
> Bill<br>
><br>
> On Sun, Jan 10, 2010 at 1:08 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>> wrote:<br>
>> On Sun, Jan 10, 2010 at 1:03 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
>>> vtk uses homogenous coordinates. Why extract a 3x3?<br>
>>><br>
>>> Bill<br>
>><br>
>> If you are implementing an algorithm that has a 3x3 multiplication and<br>
>> you want to create a rotation matrix. Or for creating a 2d rotation in<br>
>> homogeneous (now 3d) coordinates. If there is a Matrix3x3 class, you<br>
>> should be able to create common matrices in that type, no?<br>
>><br>
>> Thanks,<br>
>><br>
>> David<br>
<br>
</div>I do have a specific application. I am dealing with camera projection<br>
matrices (3x4) and to create parts of them (the left 3x3) it seems<br>
easier to deal directly with 3x3's instead of having to keep<br>
extracting a 3x3 from a 4x4.<br>
<br>
This is the 3x3 matrix class I was referring to:<br>
<a href="http://www.vtk.org/doc/nightly/html/classvtkMatrix3x3.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkMatrix3x3.html</a><br>
<br>
I think we need 3 things:<br>
1) Add RotateX(), RotateY() and RotateZ() to vtkMatrix3x3<br>
2) Convert a 3x3 to a 4x4 (adding a 1 in the (4,4) position and zeros<br>
elsewhere) - where should this function live?<br>
3) Convert a 4x4 to a 3x3 by simply extracting the upper left 3x3 -<br>
where should this function live?<br>
<div><div></div><div class="h5"><br>
Thanks,<br>
<br>
David<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a> <br>