Log in or register to post comments

clip the camera plane

October 29, 2012 - 3:56am #1


I want to show something below the camera plane, let the users feel that they can see a "hole" in the current plane, I have already set the texture z position to minus, but still all the texture below is displayed, and also I just want to cut part of the current plane, and let the current plane hide the part of the edge of the hole below when users are not vertical to the plane. so what I need to do is let upper edge of the hole aligned with the camera plane. then cut out the camera plane exactly where the hole is located.

So you have some idea to achive this?

Thank you !

clip the camera plane

November 5, 2012 - 11:58pm #7

One additional little detail is that you need to render the "plane with hole" before rendering anything else, so to write to the depth buffer before other geometry and thus obtaining the clipping effect.

clip the camera plane

November 2, 2012 - 3:45am #6

And by the way: disabling Color Mask (i.e. disabling writing to color buffer) in OpenGL is done by:

glColorMask( false, false, false, false );

clip the camera plane

November 2, 2012 - 3:42am #5

Thank you for your PM messages with details; so I'll share the answer to your problem here, hoping it can be useful to other developers as well:

So, the technique you need to use is based on rendering a plane to the "depth buffer" without rendering it to the "color buffer";

in practice, you need to create a geometry which is like a plane (a rectangle) with a rectangular hole in the middle; the rectangular hole is meant to be the same size as your hole (i.e. your top-level rectangular shape that I see in the picture;

so, let's call this new geometry as "Plane with hole" for convenience;

so, you will need to draw it (in OpenGL) with disabled color mask, so that it is rendered to the depth buffer, but not to the color buffer; this means that this "Plane with Hole" will be invisible, but on the other hand it will also hide the flank sides of your geometry (this is due to the way depth testing works in OpenGL).

The PlaneWithHole must be rendered aligned with the position and pose of the target; also, make sure the plane is big enough (i.e. much bigger than its hole in the middle)


clip the camera plane

October 30, 2012 - 1:59am #4

Hi, thanks for the clarifications, but to me it still sounds unclear what you want to achieve; 

I'm really happy to help you if I can, but could you describe in a very detailed, step-by-step way what you want to do?

If you have any graphics explaining the concept you can also send me a private message....


clip the camera plane

October 29, 2012 - 8:08am #3

Thanks for your reply, the "camera plane" I mentioned is the texture plane we get directly from the camera, a plane parellel to the camera with certain distance, this plane is from real world. and "vertical to the plane" I mean is that the mobile device is just parallel with the plane but above without bias angle.

clip the camera plane

October 29, 2012 - 5:32am #2

Hi, can you explain a bit more in detail what you mean by "camera plane" (do you mean a plane parallel to the camera and located at a certain distance from the camera, or do you mean the trackable plane, or other )?

Also, I'm not sure to understand what you mean by "vertical to the plane"...

Maybe if you precise the problem better, we can probably help with some ideas on how to achieve your effect...


Log in or register to post comments