[vtkusers] Multiple Surfaces at same height

PsyVis osue80 at bangor.ac.uk
Wed Oct 1 14:57:48 EDT 2008


Hello Gerrick
I've tried using the SetResolveCoincidentTopology functions but to no luck,
would you mind telling me if i'm doing right heres the code for the two
sepreate mappers

mesh 1 mapper:

        partMapper = new vtkPolyDataMapper();
        partMapper.SetInput(normals.GetOutput());
        // partMapperwl.SetScalarModeToUsePointData();
        partMapper.SetResolveCoincidentTopologyZShift(0.5);
        // partMapper.SetResolveCoincidentTopologyToPolygonOffset();
        partMapper.SetResolveCoincidentTopologyToShiftZBuffer();

        System.out.println("zbuff b" +
partMapper.GetResolveCoincidentTopologyZShift());

mesh 2 mapper:

        partMapperwl = new vtkPolyDataMapper();
        partMapperwl.SetInput(normals.GetOutput());
        partMapperwl.SetLookupTable(lut);
        //partMapperwl.SetResolveCoincidentTopologyToPolygonOffset();
        partMapperwl.SetResolveCoincidentTopologyZShift(0.1);
        partMapperwl.SetResolveCoincidentTopologyToShiftZBuffer();
        System.out.println("zbuff w" +
partMapperwl.GetResolveCoincidentTopologyZShift());

and here is a picture of the problem
http://www.nabble.com/file/p19766927/tiger%2Bprinting.jpeg 

Rich


Gerrick Bivins wrote:
> 
> 
> Hi Rich,
> Sounds like a z fighting problem but hard to tell without seeing.
> You could take a look at the "SetResolveCoincidentTopology" functions in
> vtkMapper to see if it can resolve your issue:
> http://www.vtk.org/doc/release/5.2/html/a00817.html#a2ea475413fed0b45566e33c
> c9f659e8
> 
> Gerrick
> 
> On 10/1/08 11:21 AM, "PsyVis" <osue80 at bangor.ac.uk> wrote:
> 
>> 
>> Hello 
>> 
>> I am trying to visualise some coastal hydrodynamical data taken from a
>> mathematical model where I've got two poly data surfaces (one
>> representing
>> the sea floor and the other representing the water level). At some points
>> the water level gets clamped to the same height as the sea floor so there
>> are two surfaces in the exact same space. When this is rendered it leaves
>> an
>> undesirable effect (almost like tiger printing - where the renderer
>> cannot
>> decide which triangles to draw on top of one another). I've tried using
>> seperate renderers(in the same renderwindow) and setting layers but this
>> doesn't work either.
>> 
>> Thanks very much
>> 
>> Rich
>> 
>> Here is the code for the rendering process
>> 
>> 
>>         vtkRenderWindow renWin = new vtkRenderWindow();
>>         renWin = renPanel.GetRenderWindow();
>>         renWin.SetNumberOfLayers(2);
>> 
>>         vtkRenderer wlRen = new vtkRenderer();
>>         wlRen = renPanel.GetRenderer();
>>         wlRen.AddActor(wlActor);
>>         wlRen.SetBackground(Colors.SLATE_GREY);
>>         wlRen.SetLayer(0);
>> 
>>         vtkCamera camera = wlRen.GetActiveCamera();
>>         camera.Zoom(1.5);
>> 
>>         wlRen.SetActiveCamera(camera);
>>        
>>         vtkRenderer ren = new vtkRenderer();
>>         ren = renPanel.GetRenderer();
>>         ren.AddActor(bActor);
>>         ren.AddActor(bbActor);
>>         ren.AddActor(edgeActor);
>>       
>>         
>>         ren.SetActiveCamera(camera);
>>         ren.SetLayer(1);
>>        
>>          renWin.AddRenderer(ren);
>>          renWin.AddRenderer(wlRen);
>>         
>> 
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-Surfaces-at-same-height-tp19742989p19766927.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list