[vtkusers] Filled circle glyphs instead of spheres

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Sun Jan 19 22:34:15 EST 2003


Hi Craig,
 You are right, vtkFollower will not work as desired.

vtkLODProp3D may be your best hope. I have never used this but it sounds
promising. You set up several pipelines with different representations of
the data, try points, low res spheres, hi res spheres as a start and then
let vtk switch dynamically from one to another LOD. You say spheres are too
slow no matter what so perhaps drop them.

3 discs arranged orthogonally could be a medium cost approximation to a
sphere.

Perhaps you could look at the vtkFollower code. You could make a derived
class which does not apply its tranform to an actor, but to polydata it has
been told about. You could pass it the polydata used for your glyph, eg a
disc. And get from it the transformed polydata as input to vtkGlyph3D. This
'should' result in the one transform being applied to the original glyph,
and hopefully then all discs should face the camera. Sounds good anyway,
perhaps it is not that easy? or it might be processor hungry?
As a quick hack I see vtkFollower will give you its matrix, so set up a
dummy actor with vtkFollower to track the camera, get its matrix and pass
to vtkTransform (if that is possible) which takes your glyph polydata and
passes it on to vtkGlyph3D?? I see vtkFollower does NOT change scale, it
sounds like you DO want this. Anyway this hack might be an easy test to see
if the idea can work.

  good luck
    Dave Pont.



                                                                                                                                                
                    "Craig N.                                                                                                                   
                    Scott"               To:     David.Pont at ForestResearch.co.nz                                                                
                    <craig.scott at c       cc:     vtkusers at public.kitware.com                                                                    
                    siro.au>             Subject:     Re: [vtkusers] Filled circle glyphs instead of spheres                                    
                                                                                                                                                
                    20/01/2003                                                                                                                  
                    16:00                                                                                                                       
                                                                                                                                                
                                                                                                                                                




Thanks for the info. Some promising leads, but still some issues. Please
see comments interspersed below.


On Mon, 2003-01-20 at 12:40, David.Pont at ForestResearch.co.nz wrote:

> Did you see the Resolution settings for vtkSphereSource?

Yes. Even when rendering with low values (they look almost like cubes)
the render time drastically increases over simple dots (as you'd
expect!).

> Read up on vtkLODActor and
vtkRenderWindowInteractor->SetDesiredUpdateRate
> ( DisplayFramesPerSecond );

Using LOD (level of detail) actors allows a faster method to be used
when the user is interacting with the scene (rotating, etc.), but when
they stop, you still have the long render time if you want spheres. If
that operation takes too long, spheres will never be selected by the
vtkLODActor. This works around the long render time, but doesn't provide
an adequately rendered scene. The solution I've been using for a while
now has been to select the LOD manually as desired via a group of radio
buttons in the GUI. Works well, I just need to be able to provide the
option of rendering as spheres/disks.

> Try vtkDiscSource, and play with the Resolution settings. You can set 0
for
> the inner radius to get a full circle.  Look at vtkFollower to have discs
> always face the camera.

I hadn't thought of vtkFollower. The snag here seems to be that
vtkFollower is an actor, not a filter. I need some way of applying what
vtkFollower does to each disk. Making use of vtkGlyph3D seems to be the
way to go, but since vtkFollower is an actor, I haven't found out how
yet.

> Try passing the point data directly to a mapper, points should render
quite
> fast. See vtkActor->GetProperty()->SetPointSize( SomethingMoreThanOne )
for
> 'phat' points (may cost speed ?).

This has been my "live with it for now" solution to date. It renders
quite fast. Using SetPointSize gives squares and not circles, but more
importantly, these do not resize when the user zooms in or out.


> You can use vtkMaskPoints to subsample the data. This could work well as
a
> low-res LOD for vtkLODProp3D.

Unfortunately, my application demands that I render all the points.


--
Dr Craig Scott, CSIRO (CMIS)
Melbourne, Australia









More information about the vtkusers mailing list