Heat Transfer Visualization with 2D Animation

This demonstration illustrates the use of Virtual Reality Toolbox MATLAB interface to create 2D off-line animation files.

Off-line animation recording mechanism is controlled by setting the relevant vrworld and vrfigure object properties. The recommended way how to record animations is using Virtual Reality Toolbox viewer GUI, nevertheless direct control of the recording is also possible.

In this example we use the heat distribution data used in vrheat example to create an animation file which can be then easily distributed and independentely viewed by others. For this kind of visualization, where static geometry represented by VRML IndexedFaceSet is coloured based on the simulation of some physical phenomenon, it is suitable to create 2D - AVI animation files. 2D animation is recorded exactly as you see it in the viewer figure, using the AVIFILE function.

There are several methods how you can record animations. In this case, we use the scheduled recording. When scheduled recording is active, a time frame is recorded into the animation file with each setting the virtual world Time property. Recording is completed when you set the scene time at the end or outsite of the pre-defined recording interval.

When using Virtual Reality Toolbox MATLAB interface, it is up to the user to set the scene time in the desired, usually from the point of view of the simulated phenomenon equidistant, times. This is the most important difference from recording the animations for virtual worlds that are associated with Simulink models, where scene time corresponds directly to the Simulink time.

Please note that the scene time can represent any independent quantity, along which you want to animate the computed solution.

This is a step-by-step demonstration. The following features are shown:

At the end of this example, the created file vrheat_anim.avi remains in the working directory for later use.