[vtkusers] Rotating a vector field

David Doria daviddoria at gmail.com
Thu Oct 7 11:43:10 EDT 2010


On Thu, Oct 7, 2010 at 11:39 AM, Jothy <jothybasu at gmail.com> wrote:

> I am not able to understand totally  what you want to do.
>
> Could you post that part of code?
>
> Jothy
>

  // Rotate gradient 90 degrees
  for(vtkIdType i = extents[0]; i < extents[1]; i++)
    {
    for(vtkIdType j = extents[2]; j < extents[3]; j++)
      {
      double* pixel =
static_cast<double*>(normalizedGradient->GetScalarPointer(i,j,0));
      double temp[2] = {pixel[0], pixel[1]};
      pixel[0] = -temp[1];
      pixel[1] = temp[0];
      }
    }

It is only short because the rotation is 90 degrees. I was just wondering if
there was a general rotation filter.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101007/1a4d4f29/attachment.htm>


More information about the vtkusers mailing list