[vtkusers] Layering renderers
Hank Childs
childs at forum.llnl.gov
Thu Aug 3 13:07:18 EDT 2000
Hello,
I added some code that layers renderers inside a render window and makes
all the layers not on the bottom layer "transparent". I heard some
clammoring on the users list a couple weeks ago for this and I needed it
myself.
I am using it to create a background layer (to put on a company logo,
etc), a layer above that for my plots, and a foreground layer where I can
overlay some things. 2D or 3D actors can be placed on any layer and there
can be an arbitrary number of layers.
There is an example in /graphics/examplesCxx/layers.cxx.
I would appreciate any feedback on problems or how to improve this.
Thanks,
Hank
Truly interested? -- read on:
This was done by making sure that the Render methods were called from the
back renderer to the front renderer and had the Clear function only clear
the color buffer if the renderer was on the back layer. The depth buffer
was still cleared each time. Thanks to Dr. Martin for pointing this out,
I originally had a more complex way of doing this.
There are some issues now with finding the poked renderer - ie which
renderer the interactor style will select to change its camera when
receiving events. If multiple layers now lie in the point of the screen
of interest, it needs to select one as the poked renderer. I added a
field to the renderer that allows it to be deemed as interactive or not
interactive. The interactor style will try to choose interactive
renderers first. It only chooses one renderer, but probably should be
able to choose all interactive renderers that cover that point. That
would be an easy change, but would require touching a lot of code.
____________________________________________________________________________
Hank Childs
MeshTV
Lawrence Livermore National Laboratory
email: childs3 at llnl.gov
More information about the vtkusers
mailing list