How do I make part of an object disappear as it comes in contact with another object?


I’m trying to get an object to disappear as it comes in contact with another object. Imagine a camera looking at a stargate or portal from the side. The object moves into the gate/portal but we don’t see it come out the other side.

I’m thinking Dynamic Paint might hold the answer. There are tons of tuts on how to paint, displace or create waves with dynamic paint, but I can’t find a tutorial that shows how to make the canvas invisible or disappear as the brush comes in contact.

Attached is a simple blend file, if you play the animation you can see Suzanne moving into the floor plane. What I want is, the part of Suzanne that has passed through the floor plane to be invisible to the camera.
PortalEntry.blend (532 KB)

Well, that’s one idea. TBH, I haven’t used dynamic paint that much, just fooled around with it a few times, but this is how I think you’d want to go about it… The mesh needs to be uv mapped with a color. The plane/portal would be the brush and would paint a transparent color - no alpha. As the mesh passes thru the plane, the uv map is painted transparent.

2 other ideas -

use a lattice on the object, create shapekeys for the lattice collapsing, make the lattice a child of the object. Then animate the shapekeys as the object passes thru the plane. I’m attaching an example of that, just right arrow thru the animation to see it work. Note that this was a quick and dirty example, only spent a few minutes on it. For a real ‘production’ type environment, I’d use more subdivisions of the lattice, make it fit the object closer, and tweak the animation curves. I think this is the route I would go if the plane has some thickness to it.

My other idea would be to use composting/trick photography. In times before vfx, if you wanted to accomplish this with a film camera, you’d block off half the lense, shoot the footage, then block off the other half of the lense, shoot the footage, and combine them. Today, you have green screen techniques, so you render one side with a green plane covering the other side. Then repeat switching which side is rendered and which side is green, then remove the green in blender’s compositor and overlay the images.

Just a couple of thoughts,



lattice_example.blend (390 KB)

The boolean modifier works really good for that add it to monkey, use a cube as object, do not render cube, use difference, parent cube to the plane.
I saw a old 2.49 dissolve a wine glass tutorial where they added particles to the effect.

You can also just use good-ole materials to mask your object. Synchronize the color ramp with the location of the object passing through the plane.


266_Text_Mask_Alpha_Ramp.blend (91.4 KB)

Here is a method for Cycles using dynamic paint, vertex colors, and a a mixed shader.

  1. create suzanne, subdivide 2-3 times and apply
  2. Create a cube and scale (planes won’t work)
  3. Animate suzanne dropping through the cube.
  4. Make the cube a brush (physics->dynamic paint), with color pure white (1,1,1)
  5. In suzanne’s object data (image #1) add a vertex color, by default it’s named ‘Col’
  6. In suzannes physics, add a canvas, In dynamic paint output -> Paintmap layer choose ‘Col’ . Change time to 1, uncheck drying
  7. Alt-a to run animation (or bake it)
  8. For suzanne’s material copy the node setup.
  9. Suzanne should disappear after passing though cube. This method could be used to create other “more interesting” mixing effects on parts of the canvas. I don’t know wiping a foggy mirror maybe.

    Won’t let me upload the blend, if you want to see it let me know, I’ll dropbox it. But it’s a pretty quick method really.

Thank you blenderallday, once again you come to my rescue :smiley: Thank you! Your approach is exactly what I was looking for, it works beautifully!

I was close in my own attempt, I was using the attribute node and mix it with a diffuse node but I didn’t dawn on me to use a Transparent and use the attribute to control the mix fac.

Nice, cool effect. It’ll look more impressive as an animation. It’s always interesting to see how many different methods people come up with for a given effect. Blender is probably the king of “more than one way to do things”. The lattice ideas might deform the mesh. Didn’t fully go over Atom’s but I’ll check it out, that guy is sick good. The boolean approach is interesting too, maybe play with that for something else.
The disk that suzanne is dropping through looks a bit odd, but maybe that’s what you wanted. And Suzanne is looking as good as ever!
Neat effect, post the anim in WIP, love to see it.

Thanks but the image of Suzanne isn’t actually for any of my projects. After getting it to work I just couldn’t help myself.

I rendered out a quick 5sec clip of it in action. Love this feature and now that I know how to use it I can’t wait to actually use it in my projects. So many possiblities :smiley:

Thanks again for your help

Cheers :slight_smile:

Ahh very cool, nice proof of concept.

Very nice, go for the animation and be sure to post the results :slight_smile: