Png As Texture

Another crucial thing for my project is to know how to show an animation in Max/MSP. Because the children will be playing with the animation and interact with the character. First of all, what i can do was to save my frames of the animation as pngs and import these pngs as a texture of the plane that i created in Max. For this plane i used jit.pwindow. It is a tool to draw pixels or graphics within a patcher and it displays jit.matrix data as well as OpenGL 3D graphics. OpenGL was what i needed. Then, I needed to put all the pngs and put them in the same folder where my Max patch is located. And also i needed to give the pngs proper names and it should be the same name in Max, too. This way they will work as a sequence.

To turn on the animation, in the ‘texture’ part, i need to click on ‘import movie’  and pick the first png of the animation. In the part ‘PngReader’, i need to turn the animation on with the toggle there. And also i need to type how many frames it has in the ‘number’ object i have there. I need to repeat this action everytime i first open this Max file.

In order to show the pngs i have seperately, i was thinking that i could make the background of the plane white and project the whole thing on a white wall. This way my animation would not have any dark frames etc. For this, i need to go to the ‘Render’ part and change the values of background color there.

Another thing was positioning of the pngs. That’s why i put a ‘positioning’ patcher there. With this patch i can change where exactly i put the pngs on the screen and even can scale them. I dont know if i would use the rotation option but depending on the script of my game, i may use it. Thats why i put a flonum connected to a ‘prepend rotate’ object.

Also, this positioning part will be the place where i move my animation, time it and make it a loop, and also compare its coordinates with the coordinates that i got from Kinect (which are already in my previous patch).

Here you can see how all three parts looks together :

 

 

 

 

 

Leave a Reply