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 "Luke" Peterson <span dir="ltr"><<a href="mailto:hazelnusse@gmail.com" target="_blank">hazelnusse@gmail.com</a>></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. 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 <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
> I'll bet your normals are point "in" rather than "out". Try vtkReverSense<br>
> on the output of your isosurface.<br>
><br>
><br>
> On Mon, Jul 2, 2012 at 2:37 PM, Dale "Luke" Peterson <<a href="mailto:hazelnusse@gmail.com">hazelnusse@gmail.com</a>><br>
> wrote:<br>
>> I tried ScalarVisibilityOff() and it didn't fix the problem. However,<br>
>> it did make me realize that the problem is different from what I<br>
>> originally thought. I've attached two window screen shots, both with<br>
>> ScalarVisibilityOff(). The only difference is that in the second one,<br>
>> I've called contourActor->GetProperty()->SetColor(0, 0, 1). You can<br>
>> see that the blue color is just barely visible.<br>
>><br>
>> Just to check, I tried setting ScalarVisibilityOn(), and then repeated<br>
>> the test with and without calling SetColor(0, 0, 1). In both cases<br>
>> the surface appears to be very dark but slightly red. So it seems<br>
>> like red is the default color for the zero-level curve, but for some<br>
>> reason, my surface is showing a whole lot darker than I would like.<br>
>><br>
>> Thanks for suggestion and let me know if you have any other ideas.<br>
>><br>
>> Thanks,<br>
>> ~Luke<br>
>><br>
>><br>
>> On Mon, Jul 2, 2012 at 10:51 AM, Jothy <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
>>> Can you try contourMapper->setScalarVisibilityOff()<br>
>>><br>
>>> Jothy<br>
>>><br>
>>> On 02-Jul-2012, at 5:52 PM, "Dale \"Luke\" Peterson"<br>
>>> <<a href="mailto:hazelnusse@gmail.com">hazelnusse@gmail.com</a>> wrote:<br>
>>><br>
>>>> I subclassed vtkImplicit function and implemented EvaluateFunction()<br>
>>>> and EvaluateGradient(). I then use vtkSampleFunction,<br>
>>>> vtkContourFilter, vtkPolyDataMapper, and vtkActor and add the actor to<br>
>>>> a renderer. I am only interested in one iso-surface, the zero<br>
>>>> iso-surface, and in the past it always displayed in red. Something<br>
>>>> changed (likely in my code) but I can't figure out what, and the the<br>
>>>> surface renders only in black. I have tried calling<br>
>>>> GetProperty()->SetColor() on the actor but this has no effect. I also<br>
>>>> tried dropping in example code for the vtkSphereSource which shows up<br>
>>>> blue, as in the tutorial. Based on this, I'm guessing that there is<br>
>>>> something going on with vtkSampleFunction, vtkContourFilter, or<br>
>>>> vtkPolyDataMapper, but I can't figure out what.<br>
>>>><br>
>>>> I am doing all of this in my own subclassed QVTKWidget, and the color<br>
>>>> used to work fine. I also have a minimal example of the surface that<br>
>>>> doesn't use QVTKWidget and it shows the surface in red. Perhaps there<br>
>>>> is something strange going on in Qt?<br>
>>>><br>
>>>> Any ideas on what might be going on?<br>
>>>><br>
>>>> The relevant code I have in the constructor of my QVTKWidget subclass<br>
>>>> is:<br>
>>>><br>
>>>> configurationSurface = vtkSmartPointer<vtkHolonomicConstraint>::New();<br>
>>>> sample = vtkSmartPointer<vtkSampleFunction>::New();<br>
>>>> sample->SetSampleDimensions(50, 50, 50);<br>
>>>> sample->SetImplicitFunction(configurationSurface);<br>
>>>> // Create the 0 isosurface<br>
>>>> contour = vtkSmartPointer<vtkContourFilter>::New();<br>
>>>> contour->SetInputConnection(sample->GetOutputPort());<br>
>>>> contour->GenerateValues(1, 0.0, 0.0);<br>
>>>> contour->Update();<br>
>>>><br>
>>>> // Map the contours to graphical primitives<br>
>>>> contourMapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br>
>>>> contourMapper->SetInputConnection(contour->GetOutputPort());<br>
>>>><br>
>>>> // Create an actor for the contours<br>
>>>> contourActor = vtkActor::New();<br>
>>>> contourActor->SetMapper(contourMapper);<br>
>>>><br>
>>>> // Has no effect: still shows up as black.<br>
>>>> contourActor->GetProperty()->SetColor(0,0,1);<br>
>>>><br>
>>>> Thanks,<br>
>>>> Luke<br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> “People call me a perfectionist, but I'm not. I'm a rightist. I do<br>
>>>> something until it's right, and then I move on to the next thing.”<br>
>>>> ― James Cameron<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<br>
>>>> <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:<br>
>>>> <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>
>><br>
>><br>
>><br>
>> --<br>
>> “People call me a perfectionist, but I'm not. I'm a rightist. I do<br>
>> something until it's right, and then I move on to the next thing.”<br>
>> ― James Cameron<br>
>><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<br>
>> <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:<br>
>> <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>
>><br>
><br>
><br>
><br>
> --<br>
> Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
--<br>
“People call me a perfectionist, but I'm not. I'm a rightist. I do<br>
something until it's right, and then I move on to the next thing.”<br>
― James Cameron<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>