[vtkusers] Drawing half a million "vtkParametricEllipsoid"s

David Doria daviddoria at gmail.com
Thu May 23 12:04:04 EDT 2013


On Thu, May 23, 2013 at 11:21 AM, VoodooCode <MaxSchererMax at gmail.com> wrote:
> You were right, it was exactly what I was looking for, but I got a slight
> little problem left.
>
> Since I have never head of tensors before I got a question about them. I
> heard that in order to rotate the object I need to multiply the tensor the
> following way:
>
> T' = RTR^t
>
> with T being the tensor,
> R the rotation matrix
> and R^t the transposed rotation Matrix.
>
> I tried to rotate a cube by 45°, but it does not rotate :S
>
> I used the rotation matrix
>
> 1 0 0
> 0 .7 -.7
> 0 .7 .7
>
> and ended up with the tensor
>
> 1 0 0
> 0 .98 0
> 0 0 .98
>
> What is it that I'm doing wrong? I want to rotate the cube by 45° along the
> x - axis.

You must use:
tensorGlyph->ExtractEigenvaluesOff();

For it to interpret the matrix directly as a rotation matrix (or
rotation + scaling). Otherwise it computes the eigenvectors of your
matrix and interprets those as the axes, which is not want here.

I have changed this example to use only two points, and display a cube
glyph with no rotation/scaling at the first point, and a glyph rotated
45 degrees around the x-axis at the second point:

http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph

David



More information about the vtkusers mailing list