[vtkusers] Visualising Vector field from an algorithm

Rob Rotheram robrotheram at gmail.com
Mon Nov 10 11:57:46 EST 2014


Hello all.

I am a Uni student trying to visualise a vector field using data
generated from an algorithm not from a file.

the algorithm  generates vector field of dimension [xs,ys,zs,3] from a
proceedural function. By passing in different time arguements,

algroithum(x,y,z,time);

I am new to vtk, and I am playing around with using the example
VectorField code:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/WishList/Visualization/VectorField

What every I seem to do :

image->SetDimensions(50,50,1);
to
image->SetDimensions(50,50,20);

{
    float* pixel = static_cast<float*>(image->GetScalarPointer(10,10,10));
        pixel[0] = 10;
        pixel[1] = 65;
        pixel[2] = -35;
    }

or adding extra float* pixel ... code he arrows always point in the
same axis just positive or negative
I also tried  setting vtkSmartPointer<vtkGlyphXD> glyphFilter from
vtkGlyph2D to 3D.

Also how would one keep the arrow color constant instead changing from
blue to red depending if the pixel is negative.

Any help be appreciated.

regards

Robert Fletcher


More information about the vtkusers mailing list