3DView Model Animation (Fade-in, Fade-out)

I have 2 models that are aligned. I would like to visually show them using an animation that fades-in the source model, while simultaneously fading out the target-model, say within a 1-second timeframe, then do vice-versa. This way, the difference between the 2 models can be readily visualized.

How can I achieve this programatically?

I know that I can alter the opacity using the following piece of code:
model1.GetDisplayNode().SetOpacity(0)
model2.GetDisplayNode().SetOpacity(1)

but I would like to animate the fade-in and fade-out process within a specified timeframe for a specified duration.

You can set up a little animation loop using QTimer, something like this.

It would be great if you could post here a video of the result that you get.

Usually we compare models in slice views (showing slice intersections with different colors) and/or by coloring the surfaces by distance (computed by ModelToModelDistance extension).

Yes, will do Prof Andras. I think the colour map is great - however because it is a 2D representation it may be limited in its visual representation. I thought the fade-in and fade-out would be good to show the visualization in 3D. I will post the video in a moment.

Video here (wireframe representation). Let me know what you guys think.

Any way I can slow down the fade-in and fade-out? Iā€™m happy with everything else.

2 Likes

You can change the timer interval and/or the opacity change step size to make the fading slower/faster.