How to mask then reveal a background video

Nov 29, 2010 at 12:20am

How to mask then reveal a background video

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.
Thanks

#53605
Nov 29, 2010 at 12:46am

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 ;)

#192742
Nov 29, 2010 at 1:28am

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

#192743
Nov 29, 2010 at 5:11am

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

– Pasted Max Patch, click to expand. –
#192744
Nov 29, 2010 at 10:35am

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 jit.gl.sketch instead of jit.gl.gridshape.

– Pasted Max Patch, click to expand. –
#192745
Nov 30, 2010 at 1:09am

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?

Cheers.

#192746
Nov 30, 2010 at 11:58am

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 jit.gl.gridshape with jit.gl.sketch and whatever you draw will act as the mask and it will stay uncovered too.

#192747
Nov 30, 2010 at 7:31pm

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 http://cycling74.com/forums/topic.php?id=29836
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

#192748
Nov 30, 2010 at 7:47pm

actually, it was scatalogic and not me ;)

#192749
Nov 30, 2010 at 8:10pm

Ooops….sorry MIB..my 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

#192750
Nov 30, 2010 at 8:41pm

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. –
#192751
Nov 30, 2010 at 8:57pm

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.

#192752
Nov 30, 2010 at 9:14pm

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.

#192753
Nov 30, 2010 at 11:34pm

Hey Scat….

I want my rendered drawing to be ‘rotatable’ but I want the background video to be static. You were saying …..it 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

#192754
Dec 1, 2010 at 8:38am

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

#192755
Dec 1, 2010 at 8:34pm

Hi Scat…

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

Cheers

#192756

You must be logged in to reply to this topic.