[vtkusers] Too many actors

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Wed Feb 11 15:02:01 EST 2004


Hi,
  you are right, too many actors.
Make just one mapper and one actor.
The 'basic' way to visualise vector fields is to specify points, then to
specify a vector at each point, then use vtkGlyph3D and pass to your
mapper, actor. There are many techniques for visualising vector fields
(vtkHedgehog, vtkStreamline...) see for example thrshldV.tcl, streamV.tcl
If you really want to specify the lines yourself create one vtkPolyData and
add points and cells (your lines) to it and pass to your mapper, actor.
If you really have a need for using vtkLineSource use vtkAppendPolyData to
collect all lines into a single polydata and pass to your mapper, actor.

 regards
     Dave P



                                                                                                               
                      "Yi-Yu Chou"                                                                             
                      <chouyiyu at hotmail        To:       vtkusers at vtk.org                                      
                      .com>                    cc:                                                             
                      Sent by:                 Subject:  [vtkusers] Too many actors                            
                      vtkusers-admin at vt                                                                        
                      k.org                                                                                    
                                                                                                               
                                                                                                               
                      12/02/2004 04:50                                                                         
                                                                                                               
                                                                                                               




Dear all,

I want to use line segments to represent a 3D vector field. However, I got
a "lagging" problem
when displaying this vector field, if the number of line segments is huge.
I think it's because of using too many actors. If there any better method
to do it ? Any suggestion will be appreciated.
Below is my code :

line = []
line_mapper = []
line_actor = []
for i in range(0, vf_points.num):
             line.append(vtkLineSource())

line[i].SetPoint1(vf_points.x[i],vf_points.y[i],vf_points.z[i])
             line[i].SetPoint2(vf_points.x[i] + vf.vx[i],vf_points.y[i] +
vf.vy[i],vf_points.z[i] + vf.vz[i])
             line_mapper.append(vtkPolyDataMapper())
             line_mapper[i].SetInput(line[i].GetOutput())
             line_actor.append(vtkActor())
             line_actor[i].SetMapper(line_mapper[i])
             tar_renderer.AddActor(line_actor[i])

_________________________________________________________________
立即申請 MSN Mobile 服務:在您的手機上收發 MSN Hotmail
http://msn.com.tw/msnmobile

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list