Hello,<br><br>I dont know mush about wrapping the code. It would be nice if anyone helps me out. Here is my code to display vectors<br><br><font color="#000000"><font color="#000000"><font color="#000000">unsigned
 
 int num_pts = x.size();<br><br>vtkPoints *pts = vtkPoints::New();<br>pts-&gt;SetNumberOfPoints(num_pts);<br><br>vtkDoubleArray
 *vecArr = vtkDoubleArray::New();<br>vecArr-&gt;SetNumberOfComponents(3);<br>vecArr-&gt;SetNumberOfTuples(num_pts);<br>
<br>for( unsigned int i=0; i &lt; num_pts; i++)<br>{<br>   
pts-&gt;InsertPoint(i, x(i), y(i), 0);<br>   vecArr-&gt;InsertTuple2(i, 
vel_u(i), vel_v(i));<br>}<br><br>unsigned int num_cells = elem.rows();  
 // elem is a matrix that contains the index of nodes of elements in the
 mesh<br>
<br>vtkCellArray *cellA = vtlCellArray::New();<br>cellA-&gt;SetNumberOfCells(num_cells);<br><br>for
 (unsigned int i=0; i &lt; num_cells; i++)<br>{<br>   
cellA-&gt;InsertNextCell(3);<br>   cellA-&gt;InsertCellPoint( elem(i, 0)
 );<br>
   cellA-&gt;InsertCellPoint( elem(i, 1) );<br>   
cellA-&gt;InsertCellPoint( elem(i, 2) );<br>}<br><br>vtkUnstructuredGrid
 *uGrid = vtkUnstructuredGrid::New();<br>uGrid-&gt;Allocate(num_cells, 
num_cells);<br>uGrid-&gt;SetCells( 
 VTK_TRIANGLE, cellA);<br>uGrid-&gt;SetPoints(pts);<br>uGrid-&gt;GetPointData()-&gt;SetVector(vecArr);<br><br>vtkGlyph2D
 *glyph = vtkGlyph2D::New();<br>glyph-&gt;SetInput(uGrid);<br>glyph-&gt;SetColorModeToColorByVector();<br>glyph-&gt;OrientOn();<br>glyph-&gt;SetScaleFactor(1);<br><br>vtkGlyphSource2D *glyphSource = vtkGlyphSource2D::New();<br>glyphSource-&gt;FilledOff();<br>glyphSource-&gt;SetGlyphTypeToArrow();<br><br>glyph-&gt;SetInputConnection(1, glyphSource-&gt;GetOutputPort());<br><br>vtkPolyDataMapper
 *gMapper = vtkPolyDataMapper::New();<br>
gMapper-&gt;SetInput( glyph-&gt;GetOutput());<br>gMapper-&gt;ScalarVisibilityOn();<br>gMapper-&gt;SetScalarRange(uGrid-&gt;GetScalarRange());<br><br>vtkActor
 *gactor = vtkActor::New();<br>gactor-&gt;SetMapper(gMapper);<br>
<br>pRenderer-&gt;AddActor(gactor);<br><br>pRenderer-&gt;Rese
 tCamera();</font></font></font><br><br>Do i need to derive a class from vtkActor and override RenderOpaqueGeometry code..?? If so, then how do i scale the glyphs..?? and which part will this code come into picture. Am not that much expert in C++ but can manage with a guidance.  <br><br>Thanks<br><br>Regards<br><blockquote><br>---------- Original message ----------<br>From:Karthik Krishnan&lt; karthik.krishnan@kitware.com &gt;<br>Date: 25 Jan 10 17:08:12<br>Subject:  Re: [vtkusers] Vector arrows form a solid patch. How to rectify??<br>To: Rakesh Patil <rakeshthp@in.com><br><br>You'll have to write your own actor wrapping around your existing code<br>and overriding RenderOpaqueGeometry. Its not hard. See several actors<br>in VTK/Rendering that scale their font size based on the size of the<br>viewport etc. You may have to do something similar scaling your glyphs<br>based on the parallel scale / view angle.<br><br>On Sat, Jan 23, 2010 at 12:49 PM, Rakesh Patil <rakeshthp@in.com
 > wrote:<br>&gt; hello,<br>&gt;<br>&gt; When i display a vector plot using vtk, it is shown very small like a dot.<br>&gt; And when i zoom into it, it gets more visible and big. But, i want it in<br>&gt; such a way, that when i display it, at the initial stage itself, the vectors<br>&gt; must be big enough that can be seen. And when we zoom into it, then the<br>&gt; arrow size must proportionately become small. I Used setscalefactor for<br>&gt; glyph object and got the arrow size increased.<br>&gt;<br>&gt; But where the data is very dense, there a solid patch is formed due to which<br>&gt; i cannot make out whats the length of the arrow. So as we zoom in, the arrow<br>&gt; size must be reduced so that at the denser location, i can differentiate<br>&gt; among two vectors. How can i do this..??<br>&gt;<br>&gt; Thanks in advance<br>&gt;<br>&gt; Regards<br>&gt; Rakesh<br>&gt;<br>&gt; Get Yourself a cool, short @in.com Email ID now!<br>&gt; _______________________________________
 ________<br>&gt; Powered by <a target=\"_blank\" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a target=\"_blank\" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; <a target=\"_blank\" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a target=\"_blank\" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br>_________________________________<br>Karthik Krishnan<br>Ph: +1 5188814919, +91 9538477060<br></rakeshthp@in.com></rakeshthp@in.com></blockquote>