Feb 28, 2010 at 10:30pm
var tempmatrix = new JitterMatrix(4,”char”,50,50);
var tempqtmovie = new JitterObject(“jit.qt.movie”);
var textures = new Array();
textures[i] = new JitterObject(“jit.gl.texture”,”ctxt”);
which doesn’t work (i get scrambled frames). And here is what i do in with poly~:
Mar 2, 2010 at 8:06pm
Haven’t had times to check out your patch and script in action, but what happens if you use a separate matrix for each jit.gl.texture. Also make sure you set adapt to zero for your destination matrix. Otherwise, it will resize.
Mar 3, 2010 at 11:10am
I tried with separate matrices with the same results. Here is a stripped down example which shows the problem. I think the srcdim settings are being ignored, since it appears that each frame contains the entire 50*3000 image.
Mar 3, 2010 at 5:10pm
Okay. Looking closer, here’s the deal:
1. setting a matrix’s srcdim/dstdim attributes doesn’t work for some other object’s matrix calc method. It works when copying from one matrix to another in the frommatrix method. This is solved by creating one matrix to render the movie into and then using the destination matrix’s frommatrix method to copy each slice. jit.qt.movie does have some ability to render to a sub region with srcrect/dstrect by setting the jit.qt.movie’s attributes, but I wouldn’t recommend it since this is less efficient than doing in the matrix copy (QT’s scaling/cropping/rotation features significantly slow down the image decompression).
var tempmatrix = new JitterMatrix(4,"char",50,50);
var tempqtmovie = new JitterObject("jit.qt.movie");
var textures = new Array();
// render jit.qt.movie to the size of the movie matrix once
// *this* function is where a matrix srcdim/dstdim
textures[i] = new JitterObject("jit.gl.texture","ctxt");
2. your patch has stack overflows since you are not popping the transform and modelview matrices you push. These need to be matched by adding the following to the bottom of your draw method.
Side note: if you want to use sliced textures like this, you can also use one large texture with offsets rather than many textures. Simply adjust your texture coordinates to match the subregion of the larger texture, or if it’s easier for your code, set the texture matrix transform accordingly.
Hope this helps.
Mar 4, 2010 at 11:46am
>Hope this helps.
extremely helpful as usual. thanks
>Side note: if you want to use sliced textures like this, you can also use one large texture with offsets rather than >many textures. Simply adjust your texture coordinates to match the subregion of the larger texture, or if it’s >easier for your code, set the texture matrix transform accordingly.
would you recommend this approach (would it be more efficient)? The first thing you mention is what i tried first, but i couldn’t figure out how to set the texture coordinates based on pixels.
You must be logged in to reply to this topic.