<div dir="ltr">If you are on OSX with Qt5 but using the old vtk QtWidget then there is a known issue where the zbuffer doesn't work I believe. The new tk OPenGL widget widget fixes the issue. If you are not on OSX then it must be something else but your code above looks fine.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 6:17 AM, Tanja Gerasimenko <span dir="ltr"><<a href="mailto:staubchen03@gmail.com" target="_blank">staubchen03@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><font size="+1">Hello!</font> </p>
<p><font size="+1">I'm very new in vtk and I'm trying to visualize a
triangular mesh describing a geometry (something like stl) with
vtk and Qt. The result seems to be half transparent or something
like that (see the picture). When I visualize it using Paraview
it looks like as a solid. I've tried to auto orient normals and
use ReverseSense but without success.</font></p>
<p><font size="+1">Could you please tell me, what am I doing wrong?</font></p>
<p><font size="+1">Thank you.<br>
</font></p>
<p><font size="+1"><br>
</font></p>
<p><font size="+1"> The code is:<br>
</font></p>
<p><font size="+1"> </font>vtkSmartPointer<vtkPoints> points
= vtkSmartPointer<vtkPoints>::<wbr>New();<br>
<br>
points->SetNumberOfPoints(<wbr>surf_mesh.pt.size());<br>
for (uint i=0; i<surf_mesh.pt.size(); ++i)<br>
{<br>
points->SetPoint(i, <a href="http://surf_mesh.pt" target="_blank">surf_mesh.pt</a>[i].x,
<a href="http://surf_mesh.pt" target="_blank">surf_mesh.pt</a>[i].y, <a href="http://surf_mesh.pt" target="_blank">surf_mesh.pt</a>[i].z);<br>
};<br>
<br>
vtkSmartPointer<vtkCellArray> polys =
vtkSmartPointer<vtkCellArray>:<wbr>:New();<br>
<br>
for (uint i=0; i<surf_mesh.tr.size(); ++i)<br>
{<br>
polys->InsertNextCell(3);<br>
polys->InsertCellPoint(<a href="http://surf_mesh.tr" target="_blank">surf_<wbr>mesh.tr</a>[i].p1);<br>
polys->InsertCellPoint(<a href="http://surf_mesh.tr" target="_blank">surf_<wbr>mesh.tr</a>[i].p2);<br>
polys->InsertCellPoint(<a href="http://surf_mesh.tr" target="_blank">surf_<wbr>mesh.tr</a>[i].p3);<br>
};<br>
<br>
vtkPolyData * polydata = vtkPolyData::New();<br>
polydata->SetPoints(points);<br>
polydata->SetPolys(polys);<br>
<br>
<br>
vtkSmartPointer<<wbr>vtkPolyDataMapper> mapper =
vtkSmartPointer<<wbr>vtkPolyDataMapper>::New();<br>
mapper->SetInputData(polydata)<wbr>;<br>
<br>
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::<wbr>New();<br>
actor->SetMapper(mapper);<br>
actor->GetProperty()-><wbr>SetRepresentationToSurface();<br>
actor->GetProperty()-><wbr>SetFrontfaceCulling(0);<br>
actor->GetProperty()-><wbr>SetBackfaceCulling(0);<br>
<br>
<br>
renderer->AddActor(actor);<br>
<br>
renderer->ResetCamera();</p>
</div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message.
Thank you.</span></div></div></div></div></div>
</div>