Forums > Jitter

How to mask then reveal a background video

Nov 29 2010 | 12:20 am

Hey Guys,
I’m doing a patch where I want to have a video hidden on the window. I then want to draw lines on that window which will reveal the video underneath the lines. I suppose it’s a bit like using an eraser on top of the window and the lines will rub out say a mask which is covering the video underneath.
Any ideas how I would go about this? I can’t seem to find anything in the tutorials or recipe books which are of benefit.
Any help gr8ly apprec8d.
I will of course post the finished patch if I can get this organised.

Nov 29 2010 | 12:46 am

I remember several patches a little while ago in a thread… can’t remember what it was called, but a quick search should do it ;)

Nov 29 2010 | 1:28 am

Hi MIB….

I’ve tried searching – I don’t know what object(s) or topics I should be searching for to get the right ‘hits’..?

Any suggestions? I don’t even know if its a mask I should be using or what would be the best way to achieve this?
If you remember the posts/thread [perhaps you could let me know….

Thank you

Nov 29 2010 | 5:11 am

quick search turned up this patch… might be helpful to you:

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

Nov 29 2010 | 10:35 am

Here’s doing it in GL world (sure this isn’t all my work if any so sorry if you are not credited!). If you want to draw lines you could use instead of

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

Nov 30 2010 | 1:09 am

Thanks Guys,
I had actually got that far, I should have explained myself a bit better. What I wanted was for the uncovered pixels/areas to remain uncovered once they were visible…any ideas on that one?


Nov 30 2010 | 11:58 am

Sorry, I don’t mean to come off rude, but did you actually try? In MIB’s example all you have to do is send jit.lcd some drawing commands and whatever you draw will stay uncovered, look in the jit.lcd help file. In my example, as I already suggested, replace with and whatever you draw will act as the mask and it will stay uncovered too.

Nov 30 2010 | 7:31 pm

Hey MIB,

You’re not coming off rude, I appreciate the input and time you experienced people take with learners such as I. I have better explained what I am trying to do here
My question here was an attempt to workaround. Perhaps you could take a look at my link and advise me what you think is the best way to achieve what I’m trying to do.

Thank you

Nov 30 2010 | 7:47 pm

actually, it was scatalogic and not me ;)

Nov 30 2010 | 8:10 pm

Ooops….sorry head’s fried trying to sort this out. Apologies.

So…….Hey Scatlogic, you are not coming off rude…..etc as above!

Thanx Guys.

Don’t forget and have a look at the patch if you have the time and let me know your much appreciated thoughts..Cheers

Nov 30 2010 | 8:41 pm

Ok, I’m including two patches here, the first seems to be what you are asking for in this thread and uses exactly the technique I suggested, ie drawing from jit.sketch used as a mask:

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

The second seems to be what you are asking for in the other thread, which is simply how to render geometry over a video background. Note the use of the ‘layer’ attribute to control what is in front and what is behind just as you would in photoshop or flash or anything similar. I think you are misunderstanding how GL stuff works though, it is not rendering a matrix with a black background and a line on top, it is rendering the line into a shared space where other things can be rendered too. Hopefully one of these is what you want.

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

Nov 30 2010 | 8:57 pm

PS- You’ve got three different threads going on this topic, best way to get coherent help is to keep it to one and post a patch that just includes your problem area simplified as much as possible.

Nov 30 2010 | 9:14 pm

Hi Scat…

Thanks for all your help. I was under the misguided notion that more posts would garner more replies/opinions but I can see that it is causing incoherency – I’ll rectify that. Gonna give your suggestions a crack now. Once again thank you – especially for your indulgence.

Nov 30 2010 | 11:34 pm

Hey Scat….

I want my rendered drawing to be ‘rotatable’ but I want the background video to be static. You were saying … is rendering the line into a shared space where other things can be rendered too…….
so does that mean that the gl.handle will affect everything in the named window and not be separately assignable to just the drawing? Sorry to be ‘doing your head in’ but it’s doing mine in – so as it’s the season for sharing – I thought I’d share my headache with you!!LOL!

Here’s the patch so far – any thoughts..?

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

Thanks again

Dec 01 2010 | 8:38 am

Looks like someone has given you the answer on your other thread (maybe it was a good tactic!). Basically you can attach the to your instead of the whole scene []

Dec 01 2010 | 8:34 pm

Hi Scat…

Thanks for all your help and patience. Seasons greetings to you and yours.


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

Forums > Jitter