[vtkusers] mapper SetResolveCoincidentTopologyToShiftZBuffer

David Netherway david.netherway at adelaide.edu.au
Tue Nov 26 01:35:15 EST 2002


There were a couple of things wrong here. First, the near plane is at depth
0.0 and the far plane is at depth 1.0. I somehow reversed this. So I changed
the depth range of the disk rather than the line but this did not help.
The other problem is that the variables involved are global variables so
that setting ResolveCoincidentTopologyToShiftZBuffer applies to all mappers
and changing the depth range changes it for all the mappers.  So changing
either the range for the disk or the  line affects both equally.

So I do not understand how this can work. Can anyone enlighten me?

David

----- Original Message -----
From: "David Netherway" <david.netherway at adelaide.edu.au>
To: "vtkusers" <vtkusers at public.kitware.com>
Sent: Friday, 22 November, 2002 1:50 PM
Subject: [vtkusers] mapper SetResolveCoincidentTopologyToShiftZBuffer - Does
this work ?


> Hello,
>
> I am trying to have 3D lines always appear in front of other geometry and
> volume ray cast images.
>
> I thought to use mapper->SetResolveCoincidentTopologyToShiftZBuffer.
>
> I have added a few test lines at the end of the disk.tcl demo - see below.
>
> ResolveCoincidentTopologyToShiftZBuffer uses a function in
> vtkOpenGlPolyDataMapper.cxx that maps the depth of the actor to a
restriced
> z range:
> glDepthRange(zRes, 1.);
>
> I map the line to the range 0.8 - 1.0 so that the line should always
appear
> in front when the camera is rotated but this is not the case for me.
>
> I am using an NVIDIA GeForce 256 graphics card.  The card may not be
> implementing glDepthRange.
>
> Does anyone get the expected behaviour?
>
> There is no test presently in vtk that tests this method. (My version is a
> nightly CVS of about 3 months ago).
>
> Thanks, David
>
>
>
> # disk.tcl demo
>
> package require vtk
>
> package require vtkinteraction
>
> # Create the RenderWindow, Renderer and both Actors
>
> #
>
> vtkRenderer ren1
>
> vtkRenderWindow renWin
>
> renWin AddRenderer ren1
>
> vtkRenderWindowInteractor iren
>
> iren SetRenderWindow renWin
>
> vtkDiskSource disk
>
> disk SetInnerRadius 1.0
>
> disk SetOuterRadius 2.0
>
> disk SetRadialResolution 1
>
> disk SetCircumferentialResolution 20
>
> vtkPolyDataMapper diskMapper
>
> diskMapper SetInput [disk GetOutput]
>
> vtkActor diskActor
>
> diskActor SetMapper diskMapper
>
> # Add the actors to the renderer, set the background and size
>
> #
>
> ren1 AddActor diskActor
>
> ren1 SetBackground 0.1 0.2 0.4
>
> renWin SetSize 200 200
>
> # Get handles to some useful objects
>
> #
>
> iren AddObserver UserEvent {wm deiconify .vtkInteract}
>
> iren Initialize
>
> renWin Render
>
>
>
> # prevent the tk window from showing up then start the event loop
>
> wm withdraw .
>
> #----------added test code----------------------------
>
> vtkLineSource testLine
>
> testLine SetPoint1 0 0 0
>
> testLine SetPoint2 2.5 0.0 1.0
>
> vtkPolyDataMapper testLineMapper
>
> testLineMapper SetInput [testLine GetOutput]
>
> vtkActor testLineActor
>
> testLineActor SetMapper testLineMapper
>
> [testLineActor GetProperty] SetColor 1.0 0.0 0.0
>
> ren1 AddActor testLineActor
>
> testLineMapper SetResolveCoincidentTopology 1
>
> testLineMapper SetResolveCoincidentTopologyToShiftZBuffer
>
> testLineMapper SetResolveCoincidentTopologyZShift 0.8
>
> #---- end test code --------------------------------
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list