PDA

View Full Version : masking in 3D?



jaypozo
04-09-2010, 12:24 PM
Hi there,

I'm really new to OpenGL and am hoping someone here can help with a problem we're having. I'm using an openframeworks library to take an animated model in collada data and draw it to the screen. I want to crop a section of this model when it's drawn to the screen, which is being drawn using openGL. Is there a way to do this? I've read about the stencil buffer but am wondering if there is a better, maybe simpler way.

Thanks.
Jay

Aeluned
04-09-2010, 12:37 PM
you can look into GL_SCISSOR_TEST.

You can also set up your own clipping planes using glClipPlane if you need a non-rectangular clipping region.

jaypozo
04-09-2010, 02:26 PM
awesome. a glClipPlane that I move with a transform matrix did the trick. Thanks!