<div dir="ltr"><div><div></div>Have you tried to display &quot;smoothed&quot; instead of &quot;triangleCellNormals&quot;?<br></div>Are you sure smoothed consists of polygons?<div><div>If for example it had only lines triangleCellNormals would have nothing in.<br>
</div><div><br>Alex<br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 28, 2013 at 12:45 PM, ThinkFlow <span dir="ltr">&lt;<a href="mailto:neto@caltech.edu" target="_blank">neto@caltech.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am trying to render the polydata that results after passing in a<br>
vtkRectilinearGrid into vtkContourFilter. However, I keep getting a black<br>
screen. There were a few questions like mine that were already answered, but<br>
when I tried out those fixes, I still got a black screen. When I render the<br>
vtkRectilinearGrid data by itself without passing it through<br>
vtkContourFilter, it works.<br>
<br>
    vtkRectilinearGridReader *reader = vtkRectilinearGridReader::New();<br>
<br>
    reader-&gt;SetFileName(prefix_suffix);<br>
    reader-&gt;Update();<br>
<br>
    // Create a grid<br>
    vtkSmartPointer&lt;vtkRectilinearGrid&gt; grid = reader-&gt;GetOutput();<br>
<br>
    vtkContourFilter* contour = vtkContourFilter::New();<br>
<br>
    contour-&gt;SetInput(grid);<br>
<br>
    contour-&gt;SetNumberOfContours(3);<br>
<br>
    contour-&gt;ComputeNormalsOn();<br>
<br>
    contour-&gt;Update();<br>
<br>
    vtkPolyData *smoothed_polys = contour-&gt;GetOutput();<br>
<br>
    // calc cell normal<br>
    vtkPolyDataNormals *triangleCellNormals= vtkPolyDataNormals::New();<br>
<br>
    #if VTK_MAJOR_VERSION &lt;= 5<br>
        triangleCellNormals-&gt;SetInput(smoothed_polys);<br>
    #else<br>
        triangleCellNormals-&gt;SetInputData(smoothed_polys);<br>
    #endif<br>
<br>
    triangleCellNormals-&gt;ComputeCellNormalsOn();<br>
    triangleCellNormals-&gt;ComputePointNormalsOff();<br>
    triangleCellNormals-&gt;ConsistencyOn();<br>
    triangleCellNormals-&gt;AutoOrientNormalsOn();<br>
    triangleCellNormals-&gt;Update(); // creates vtkPolyData<br>
<br>
    vtkPolyDataMapper* contourMapper = vtkPolyDataMapper::New();<br>
    contourMapper-&gt;SetInput(triangleCellNormals-&gt;GetOutput());<br>
<br>
     vtkActor* contourActor = vtkActor::New();<br>
     contourActor-&gt;SetMapper(contourMapper);<br>
<br>
    // Create a renderer, render window, and interactor<br>
    vtkRenderer* renderer = vtkRenderer::New();<br>
    vtkRenderWindow *renderWindow = vtkRenderWindow::New();<br>
    vtkRenderWindowInteractor *renderWindowInteractor =<br>
vtkRenderWindowInteractor::New();<br>
<br>
    // Add the actors to the scene<br>
    renderWindow-&gt;AddRenderer(renderer);<br>
    renderWindowInteractor-&gt;SetRenderWindow(renderWindow);<br>
    renderer-&gt;AddActor(contourActor);<br>
<br>
    // Render and interact<br>
    renderWindow-&gt;Render();<br>
    renderWindowInteractor-&gt;Start();<br>
<br>
Thanks,<br>
<br>
Naoki<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/RectilinearGrid-into-vtkContourFilter-tp5723107.html" target="_blank">http://vtk.1045678.n5.nabble.com/RectilinearGrid-into-vtkContourFilter-tp5723107.html</a><br>

Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>