Hi,<br><br>I have a 3D Grid and I am trying to draw arrows between some grid block pairs. However I do not see any arrows.<br><br>Can anyone please tell me what I am missing or doing wrong.<br><br><br>The relevant code is as follows<br>
<br><br><br>vtkGlyph3D * glyph = vtkGlyph3D::New();<br>vtkPolyDataMapper * glyphMapper = vtkPolyDataMapper::New();<br>
vtkActor * glyphActor = vtkActor::New();<br><br> vtkArrowSource *arrow = vtkArrowSource::New();<br> arrow->SetTipResolution(6);<br> arrow->SetTipRadius(0.1);<br> arrow->SetTipLength(0.35);<br> arrow->SetShaftResolution(6);<br>
arrow->SetShaftRadius(0.03);<br><br> vtkPoints *points = vtkPoints::New();<br> vtkPolyData *polydata = vtkPolyData::New();<br><br>for( some grid block pairs)<br>{<br> points->InsertNextPoint(x1, y1, z1);<br>
points->InsertNextPoint(x2, y2, z2); <br> <br> polydata->SetPoints(points); <div id=":ub"> <br><br> glyph->SetInput(polydata); <br>
glyph->SetSourceConnection(arrow->GetOutputPort());<br><br> glyph->SetVectorModeToUseVector();<br> glyph->SetScaleModeToScaleByVector();<br> glyph->SetScaleFactor(0.25);<br>
glyph->Update(); <br><br> <br> glyphMapper->SetInputConnection(glyph->GetOutputPort()); <br> glyphActor->SetMapper(glyphMapper);<br>
<br> ren->AddActor(glyphActor);<br><br>}<br><br>Here (x1, y1, z1) and (x2, y2, z2) are the centers of the grid blocks in each pair. <br>
<br>Thanks,<br>Bhanu<br></div>