[vtk-developers] vtkMatrix3x3 vs vtkMatrix4x4 creation

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Sep 24 13:10:01 EDT 2010


On Fri, Sep 24, 2010 at 12:37 PM, Sean McBride <sean at rogue-research.com>wrote:

> Hi all,
>
> Both vtkMatrix3x3.h and vtkMatrix4x4.h document their creation API like so:
>
>  // Construct a 3x3 identity matrix.
>  static vtkMatrix3x3 *New();
>
>  // Construct a 4x4 identity matrix.
>  static vtkMatrix4x4 *New();
>
> But looking at the implementations, it seems that creating a 3x3 _does_
> create an identity matrix, but creating a 4x4 does _not_.
>
> It seems weird that two very similar clases diverge in this way.  Why is
> this?  And what should be done?  I propose changing vtkMatrix4x4 to
> conform to its documented behaviour.
>
> I wrote the 3x3 and it did not occur to me not to initialize it to the
identity. It came much later than the 4x4 matrix, and at the time I did not
want to change too much in the 4x4 class as so much uses it. What you
propose certainly seems reasonable to me.

Marcus
--
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100924/a56f6789/attachment.html>


More information about the vtk-developers mailing list