Forums > Jitter scale and position issues

Jan 03 2011 | 12:40 am

I know I am missing something fundamental. I have been banging my head against a wall and I don’t seem to be able to find the answer…

I use to display a picture (eventually video). Fine so far.
I then cut out a piece of the original jit.matrix using "srcdim" end "dstdim" and store that in a new matrix of the new size. Also fine.

I now put that small cutout into a and display it on top of the original videoplane. I would like it to be at the exact position and scale of the original so that initially no one can tell there is an overlay happening. This way I can gradually change certain aspects of the picture and rearrange them as well later on.

This is where I lose it. I have exact coordinates of the cutout but in screencoordinates. I use (bound to my context) to convert this to world coordinates. I guess that’s fine too. The scale however I am lost with.

I am attaching what I have so far. If someone could have a look and give me some pointers, maybe refer me to some tuts I overlooked. I am really lost right now and any help will be greatly appreciated!!!

Thanks in advance.

-- Pasted Max Patch, click to expand. --

Jan 04 2011 | 7:54 pm

you might want to try the orthographic projection (@ortho 1 or 2 on your gl.render).
you can also try @transform_reset 1 or 2 on your gl.videoplanes.

Jan 04 2011 | 8:08 pm

thanks. the ortho 2 message was very helpful.
I figured out how to do the scaling. was much easier than I thought. but the translation from screen to world coordinates for the location of my rect still bothers me.
What I do right now is calculate the center of my rect, then use "screentoworld $1 $2" to get it converted. Unfortunately, what I get out of it isn’t even close to where the rect should be.
Am I missing a crucial step here?

apologies, but gl is self-thought and that has been a while. I didn’t use it, now I lost it :(

Thanks for any insights.

Jan 06 2011 | 9:51 pm

can you post a very simple example of your problem?

Jan 08 2011 | 7:47 pm

I tried to isolate the problem, and wouldn’t you know, when I simplify it it goes away!!! driving me bonkers because I still can’t see how my main patch is different. Well, gonna go bug hunting for the weekend I guess :(

thanks for your help

Viewing 5 posts - 1 through 5 (of 5 total)

Forums > Jitter