Example Code

3D Picture Control - Create a Moving Texture Using an AVI

Code and Documents

Attachment

There are several ways to create a moving texture in the LabVIEW 3D picture control, each with pro's and con's.

This method uses an AVI file, on each iteration of the loop it loads the next AVI frame and maps this onto the object of the texture.

The advantage of this is a very large AVI file can used and minimal memory is used as only one frame is in memory at a time.

The disadvantage of this method is that on each iteration of the loop the AVI frame has to be converted into the correct format, this takes CPU time and the update rate will suffer.  The larger the resolution of the AVI file, the longer to convert each frame.

The code loads the AVI selected on the front panel and loops through the frames.

This is a simple demo using a sphere and (a rather bad!) video to create a rotating earth with the weather clouds moving.  The rotating earth is just an additional feature and is not core to the texture functionality.

If the AVI is relatively short the alternative is to convert the AVI to a series of images and pre-load these.  Take a look at this example: 3D Picture Control - Create a Moving Texture Using a Series of Images

FP.JPG

BD.JPG

Posted in LabVIEW 8.6, happy to post for previous version on request.

------
John.P | Certified LabVIEW Architect | NI Alliance Member

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors