Camera tracking: 3D Object behind a real life box - how?

I have shot a footage and got a pretty good track/solve error. I deliberatly shot it so that there is a real life object in the way of where I want my 3D objects, and I want to model that box (it is simply just a box!) around the real life box, and then hide the other 3D object.

But I can’t figure out how to do the masking.

I have googled for several days to find a decent tutorial on how to do this, and I can’t find any. Please help me, or provide some decent instructions for a newbie like me.

Anyone here to help?

Anyone here to help?
Less than 90 mins, please me more patient !! Next time just let me know when you have posted and I’ll drop everything !!!

For an overview of masking

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Mask_Editor

@Richard, I think it’s even simpler than that.

If you’ve got a good solve, just model a simple box where the real-life box is and put that on a different layer than your 3d object. then when rendering, set up the 3d object’s render layer and have the simple box layer be a mask layer for it. Done and done, no masking or roto required.

I figured it out.

Model a box around the real world box. Make the material Transparent with the type of Mask and set Alpha to 0.

It doesn’t require Compositing. Its really simple.

Steve-
This really does work fantastic. Quick and easy.

Philosopher- this is pretty elegant as well.

Still, I’m with Richard on this one. Take a look at the first link he offered on Youtube by Mikalis Gkiokas. It may seem time consuming, but after a few tries, you’ll see how much flexibility you have.

But for simple masking your solution can’t be beat. I had not actually played with the mask material yet. Thanks!