[vtkusers] Weird 3D result deducted by setting actor.UserMatrix manually.

David Feng dfeng at cs.unc.edu
Tue Jan 12 09:29:49 EST 2010


Your matrix looks a bit odd.  Why are you setting the values in the
4th column twice, with different values?  Regardless, it looks like
the first 3x3 elements are doing some combined rotation and scaling.
I'm not sure about this, but if the transform gets used in normal
computation, a bad transform could result in something strange like
what you're seeing.  Maybe try starting with a simpler matrix
(identity, 90 degree rotation, simple translation, etc) and see if you
still have your problem.

Just to clarify -- are you trying to use vtkVolume to rendering a
polygonal sphere?  You should probably be using a vtkActor, if so.

David

On Mon, Jan 11, 2010 at 11:53 PM, superzz <jxdw_zlf at yahoo.com.cn> wrote:
>
> My program is servered as a 3D renderer with actor wold calculated by another
> program. So I need to manually set actor world by actor->SetUserMatrix.
>
> But it results a weird result. The screenshot is taken by rendering a sphere
> with the world specified.
>
> It seems that only part of sphere edge is shown. When applying the world to
> vtkVolume, it completely renders nothing to screen.
>
> The world value is specified by
>
>            vtkMatrix4x4 worldMatrix = vtkMatrix4x4::New();
>            worldMatrix->SetElement(0, 3, 0.1121497);
>            worldMatrix->SetElement(1, 3, 0.08815035);
>            worldMatrix->SetElement(2, 3, -0.08844081);
>            worldMatrix->SetElement(3, 3, 1);
>
>
>            worldMatrix->SetElement(0, 0, -0.0008999974);
>            worldMatrix->SetElement(1, 0, -2.600985E-09);
>            worldMatrix->SetElement(2, 0, 1.529991E-06);
>            worldMatrix->SetElement(3, 0, 0);
>
>            worldMatrix->SetElement(0, 1, 1.69999E-06);
>            worldMatrix->SetElement(1, 1, -1.69999E-06);
>            worldMatrix->SetElement(2, 1, 0.0009999943);
>            worldMatrix->SetElement(3, 1, 0);
>
>            worldMatrix->SetElement(0, 2, -2.889984E-09);
>            worldMatrix->SetElement(1, 2, -0.0009999971);
>            worldMatrix->SetElement(2, 2, -1.69999E-06);
>            worldMatrix->SetElement(3, 2, 0);
>
>            worldMatrix->SetElement(0, 3, 0.09686619);
>            worldMatrix->SetElement(1, 3, 0.08823382);
>            worldMatrix->SetElement(2, 3, -0.07871468);
>            worldMatrix->SetElement(3, 3, 1);
>
> http://old.nabble.com/file/p27122648/sphere.JPG sphere.JPG
>
> Thanks!
>
> superZZ
> --
> View this message in context: http://old.nabble.com/Weird-3D-result-deducted-by-setting-actor.UserMatrix-manually.-tp27122648p27122648.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
http://www.cs.unc.edu/~dfeng



More information about the vtkusers mailing list