[vtkusers] vtkImageActor layers/bring to front?
John Drescher
drescherjm at gmail.com
Mon Feb 14 09:12:06 EST 2011
On Mon, Feb 14, 2011 at 9:06 AM, David Doria <daviddoria at gmail.com> wrote:
> On Mon, Feb 14, 2011 at 9:00 AM, Karthik Krishnan
> <karthik.krishnan at kitware.com> wrote:
>>
>> If the two images are at the same location in space, it seems like you
>> should blend the two images (vtkImageBlend) and then display it.
>>
>> If they are at different depths, you can achieve transparency either by
>> setting the opacity on both or on the actor closer to the camera to be
>> non-zero.
>> Alternatively to achieve transparency on selected regions of an image, you
>> can give it RGBA or LA (2 or 4 component) data. The last component will be
>> treated as alpha value for the pixel.
>>
>> I would suggest that you dither one of the images by a small amount.
>
>
> Hi Karthik,
> I don't want to blend them - I want to have the option to toggle which one
> is in front. They are both RGBA valued, with different alphas in different
> regions. So is the only way to achieve this to actually translate one of
> them to be in front of the other, and switch which one is translated to
> toggle which one is in front?
>
I have not looked at this in a long while but I know that the order of
which one you add to the renderer controls this. So you could possibly
remove both actors from the renderer and readd them in the opposite
order and that would toggle which one was on top of the other.
John
--
John M. Drescher
More information about the vtkusers
mailing list