re-write mat file controlling .tga file to one controlling a video file

[ClassInfo]
ClassName TMaterial
[Layer0]
TextureName background.wmv
tfNoWriteZ 1
tfNoDegradation 1
tfMinLinear 1
tfMagLinear 1
The above contents of a mat file control the apperance in game of a static image .tga file which functions as a menu background to a loading facility.
the game has an open source philospohy where users (the public owners) may manipulate certain files in the game (made openly availaable such as config.ini etc). This is so the game's potential increases with public use and innovation inside the game.
i would like to re-write this mat file to display a video file instead of the .tga file. Is it possible?
I am not familiar with matlab being of the FORTRAN generation.
Thanks in advance

1 Comment

Wow, that's a blast from the past. I haven't heard of anyone using tga files (targa) in at least 20 years!

Sign in to comment.

Answers (2)

A mat file is just a data file. So writing or re-writing a mat file (which you do with the save() function) does not display anything. You can display things with image(), imshow(), imagesc(), and movie(). I'm not sure how your mat file is involved at all. For your video file, you can read that in with the VideoReader Class. Feel free to explain better what you have and what you want to do.

3 Comments

The calling file is named background with the property of being a MAT file. background.tga may call a different image and display it as the background as long as the file is re-named background or in in some way appropriate eg background1.tga, or backgroundA.tga etc. and that name would have to be mirrored in the above 'MAT' file to have the different image displayed as the background1 etc.
The actual.tga file to be displayed by the game is stored in and called from the same folder in which the MAT file is stored. I was thinking that if the proposed video file was stored in that same folder and obeyed the call that seems to come from Texturename then the video might display in the same manner as a the static background.tga file. Answer 2 seems to suggest this may be a possibility worth exploring. I also undestand Answer 2 saying this is not a MAT file; only in its properties is it designated a MAT file.
I understand answer 1 suggestion that to dispaly the movie A program might have to be written that processess each individual frame of the movie clip and displays with a command. Perhaps a for loop and a read command.
Is this a text file that can be edited?
If you go into MATLAB and ask
whos -file background.mat
then what does it respond?
response is file undefined

Sign in to comment.

Who knows? That isn't a .mat file, and there is no reference there to a .tga file. It does appear to reference background.wmv which is probably a Windows Media Video file, so if that is indicating something to be displayed perhaps you just need to change the name of the file listed in the texture.

Categories

Find more on Just for fun in Help Center and File Exchange

Asked:

on 16 Feb 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!