No. You triangles have have a reversed sense. Usually the inside of the surface has higher valuse than the outside. If this is not the case, the triangles will have a reversed sense.<br><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 3:05 PM, Dale &quot;Luke&quot; Peterson <span dir="ltr">&lt;<a href="mailto:hazelnusse@gmail.com" target="_blank">hazelnusse@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I flipped the sign of the gradient in EvaluateGradient() and nothing<br>
changed. &nbsp;That should have the same effect, correct?<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jul 2, 2012 at 11:54 AM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;ll bet your normals are point &quot;in&quot; rather than &quot;out&quot;. &nbsp;Try vtkReverSense<br>
&gt; on the output of your isosurface.<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jul 2, 2012 at 2:37 PM, Dale &quot;Luke&quot; Peterson &lt;<a href="mailto:hazelnusse@gmail.com">hazelnusse@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt; I tried ScalarVisibilityOff() and it didn&#39;t fix the problem. &nbsp;However,<br>
&gt;&gt; it did make me realize that the problem is different from what I<br>
&gt;&gt; originally thought. &nbsp;I&#39;ve attached two window screen shots, both with<br>
&gt;&gt; ScalarVisibilityOff(). &nbsp;The only difference is that in the second one,<br>
&gt;&gt; I&#39;ve called contourActor-&gt;GetProperty()-&gt;SetColor(0, 0, 1). &nbsp;You can<br>
&gt;&gt; see that the blue color is just barely visible.<br>
&gt;&gt;<br>
&gt;&gt; Just to check, I tried setting ScalarVisibilityOn(), and then repeated<br>
&gt;&gt; the test with and without calling SetColor(0, 0, 1). &nbsp;In both cases<br>
&gt;&gt; the surface appears to be very dark but slightly red. &nbsp;So it seems<br>
&gt;&gt; like red is the default color for the zero-level curve, but for some<br>
&gt;&gt; reason, my surface is showing a whole lot darker than I would like.<br>
&gt;&gt;<br>
&gt;&gt; Thanks for suggestion and let me know if you have any other ideas.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; ~Luke<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jul 2, 2012 at 10:51 AM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; Can you try contourMapper-&gt;setScalarVisibilityOff()<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Jothy<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 02-Jul-2012, at 5:52 PM, &quot;Dale \&quot;Luke\&quot; Peterson&quot;<br>
&gt;&gt;&gt; &lt;<a href="mailto:hazelnusse@gmail.com">hazelnusse@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I subclassed vtkImplicit function and implemented EvaluateFunction()<br>
&gt;&gt;&gt;&gt; and EvaluateGradient(). &nbsp;I then use vtkSampleFunction,<br>
&gt;&gt;&gt;&gt; vtkContourFilter, vtkPolyDataMapper, and vtkActor and add the actor to<br>
&gt;&gt;&gt;&gt; a renderer. &nbsp;I am only interested in one iso-surface, the zero<br>
&gt;&gt;&gt;&gt; iso-surface, and in the past it always displayed in red. &nbsp;Something<br>
&gt;&gt;&gt;&gt; changed (likely in my code) but I can&#39;t figure out what, and the the<br>
&gt;&gt;&gt;&gt; surface renders only in black. &nbsp;I have tried calling<br>
&gt;&gt;&gt;&gt; GetProperty()-&gt;SetColor() on the actor but this has no effect. &nbsp;I also<br>
&gt;&gt;&gt;&gt; tried dropping in example code for the vtkSphereSource which shows up<br>
&gt;&gt;&gt;&gt; blue, as in the tutorial. &nbsp;Based on this, I&#39;m guessing that there is<br>
&gt;&gt;&gt;&gt; something going on with vtkSampleFunction, vtkContourFilter, or<br>
&gt;&gt;&gt;&gt; vtkPolyDataMapper, but I can&#39;t figure out what.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I am doing all of this in my own subclassed QVTKWidget, and the color<br>
&gt;&gt;&gt;&gt; used to work fine. &nbsp;I also have a minimal example of the surface that<br>
&gt;&gt;&gt;&gt; doesn&#39;t use QVTKWidget and it shows the surface in red. &nbsp;Perhaps there<br>
&gt;&gt;&gt;&gt; is something strange going on in Qt?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Any ideas on what might be going on?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The relevant code I have in the constructor of my QVTKWidget subclass<br>
&gt;&gt;&gt;&gt; is:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &nbsp;configurationSurface = vtkSmartPointer&lt;vtkHolonomicConstraint&gt;::New();<br>
&gt;&gt;&gt;&gt; &nbsp;sample = vtkSmartPointer&lt;vtkSampleFunction&gt;::New();<br>
&gt;&gt;&gt;&gt; &nbsp;sample-&gt;SetSampleDimensions(50, 50, 50);<br>
&gt;&gt;&gt;&gt; &nbsp;sample-&gt;SetImplicitFunction(configurationSurface);<br>
&gt;&gt;&gt;&gt; &nbsp;// Create the 0 isosurface<br>
&gt;&gt;&gt;&gt; &nbsp;contour = vtkSmartPointer&lt;vtkContourFilter&gt;::New();<br>
&gt;&gt;&gt;&gt; &nbsp;contour-&gt;SetInputConnection(sample-&gt;GetOutputPort());<br>
&gt;&gt;&gt;&gt; &nbsp;contour-&gt;GenerateValues(1, 0.0, 0.0);<br>
&gt;&gt;&gt;&gt; &nbsp;contour-&gt;Update();<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &nbsp;// Map the contours to graphical primitives<br>
&gt;&gt;&gt;&gt; &nbsp;contourMapper = vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
&gt;&gt;&gt;&gt; &nbsp;contourMapper-&gt;SetInputConnection(contour-&gt;GetOutputPort());<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &nbsp;// Create an actor for the contours<br>
&gt;&gt;&gt;&gt; &nbsp;contourActor = vtkActor::New();<br>
&gt;&gt;&gt;&gt; &nbsp;contourActor-&gt;SetMapper(contourMapper);<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &nbsp;// Has no effect: still shows up as black.<br>
&gt;&gt;&gt;&gt; &nbsp;contourActor-&gt;GetProperty()-&gt;SetColor(0,0,1);<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt; Luke<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; &ldquo;People call me a perfectionist, but I&#39;m not. I&#39;m a rightist. I do<br>
&gt;&gt;&gt;&gt; something until it&#39;s right, and then I move on to the next thing.&rdquo;<br>
&gt;&gt;&gt;&gt; &#8213; James Cameron<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt;&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; &ldquo;People call me a perfectionist, but I&#39;m not. I&#39;m a rightist. I do<br>
&gt;&gt; something until it&#39;s right, and then I move on to the next thing.&rdquo;<br>
&gt;&gt; &#8213; James Cameron<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
--<br>
&ldquo;People call me a perfectionist, but I&#39;m not. I&#39;m a rightist. I do<br>
something until it&#39;s right, and then I move on to the next thing.&rdquo;<br>
&#8213; James Cameron<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>