[vtkusers] How to merge plane and lines together?

hp.shen hp.shen at ansys.com.cn
Tue Apr 25 22:42:29 EDT 2006


Hi,all
 
I drew a plane using vtkPlaneSource, and draw a line(with a different
color) on the plane. When I rotate them I found some parts of the line
was covered by the plane at 
some view angles and the line flickered. I don't know whether there are
some tricks to solve the problem?
 
Any idea is appreciated!
 
Peace
 
#Codes
package require vtk
package require vtkinteraction
                                                        
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
ren1 SetBackground 0 0 0
renWin SetSize 400 400
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize
wm withdraw .
 
#plane
vtkPlaneSource plane
    plane SetResolution 1 1
    
       vtkPolyDataMapper planemap
           planemap SetInputConnection [plane GetOutputPort]
       vtkActor planeact
           planeact SetMapper planemap
           [planeact GetProperty] SetColor 0.5 0.5 0.5
           
 
#line
vtkPoints pts
pts InsertNextPoint 0 1 0
pts InsertNextPoint 0 -1 0
 
vtkCellArray line
              line InsertNextCell 2
         line InsertCellPoint 0
         line InsertCellPoint 1
         
vtkPolyData data
           data SetPoints pts
           data SetLines line
       
vtkDataSetMapper map
             map SetInput data
  
vtkActor lineact
                lineact SetMapper map
                [lineact GetProperty] SetColor 1 1 1
 
#Draw
ren1 AddActor planeact           
ren1 AddActor lineact
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060426/c23b1ebb/attachment.htm>


More information about the vtkusers mailing list