Forums > Java

How to load a movie texture

July 18, 2009 | 8:41 am

In my application I am loading a movie as my texture to be rendered in a Java external
I can see the first frame of the movie but it is not playing

texture             = new JitterObject("jit.gl.texture");
texture.setAttr("drawto", "draw_plane");
texture.setAttr("name", "textureBackground");
texture.setAttr("automatic ", 0);
texture.send("read", new Atom[] { Atom.newAtom("dishes.mov") });

now I render the texture on to a quads. I can see the first frame of the move. It is not playing. How should I start the movie?
If anyone can provide a sample code I would really appreciate it.

sketch.send("glpushmatrix");
sketch.send("glpushattrib");
sketch.send("glenable", "texture");

sketch.send("glbindtexture", "textureBackground");

sketch.send("glbegin", "quads");
	sketch.send("gltexcoord", new float[]{ 0.0f,  0.0f });
	sketch.send("glvertex", v1_back);
	sketch.send("gltexcoord", new float[]{ 1.0f,  0.0f });
	sketch.send("glvertex", v2_back);
	sketch.send("gltexcoord", new float[]{ 1.0f,  1.0f });
	sketch.send("glvertex", v3_back);
	sketch.send("gltexcoord", new float[]{ 0.0f,  1.0f });
	sketch.send("glvertex", v4_back);

sketch.send("glend");
sketch.send("gldisable", "texture");
sketch.send("glpopattrib");
sketch.send("glpopmatrix");

Viewing 1 post (of 1 total)