GLCLIPPLANE(3G)
π GLCLIPPLANE π
okay bestie, welcome to glClipPlane(3G) β the manual page that's literally about slicing your geometry with extra planes. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
glClipPlane β specify a plane against which all geometry is clipped. yes, that's the whole vibe. it's giving βοΈ but make it 3D.
πΈ C SPECIFICATION πΈ
void glClipPlane( GLenum plane,
const GLdouble *equation )
copy that exactly, don't freestyle the signature, i'm watching π
π PARAMETERS π
planeβ which clipping plane you're positioning, bestie. you use the symbolic names that look likeGL_CLIP_PLANEi, whereiis an integer between0andGL_MAX_CLIP_PLANESβ1. those are the only accepted ones, periodt.equationβ the address of an array of four double-precision floating-point values. these four get interpreted as a plane equation. four. not three. not five. four, iykyk. π«Ά
π¦ DESCRIPTION π¦
so here's the tea. geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z β that's just the baseline, no cap. but glClipPlane lets you specify additional planes, and they don't even have to be perpendicular to the x, y, or z axis. anything goes. all your geometry gets clipped against them too.
wanna know the max number of extra clipping planes you can have? call glGetIntegerv with argument GL_MAX_CLIP_PLANES. literally every implementation supports at least six of these extra clipping planes, so you're covered. and because the resulting clipping region is the intersection of all the defined half-spaces, it's always convex. always. iconic behaviour tbh.
now, glClipPlane specifies a half-space using a four-component plane equation. when you call glClipPlane, equation gets transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. and listen β subsequent changes to the modelview matrix have no effect on the stored plane-equation components. it's locked in, bestie. π
here's the vibe check: if the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or zero, that vertex is in with respect to that clipping plane. otherwise, it's out. that's the whole test. slay.
to enable and disable clipping planes, call glEnable and glDisable with the argument GL_CLIP_PLANEi, where i is the plane number. simple as that.
and fun fact: all clipping planes are initially defined as (0, 0, 0, 0) in eye coordinates and are disabled. they're asleep. let them rest π΄
β NOTES β
it is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0+i. always always. write it down. put it on your wall. π§
π ERRORS π
heads up, these will ruin your day if you're not careful.
GL_INVALID_ENUMis generated ifplaneis not an accepted value. so likeβ¦ use the right enum, babe. πGL_INVALID_OPERATIONis generated ifglClipPlaneis executed between the execution ofglBeginand the corresponding execution ofglEnd. don't do that. that's a crime in this house. π
π₯ ASSOCIATED GETS π₯
glGetClipPlaneglIsEnabledwith argumentGL_CLIP_PLANEi
π SEE ALSO π
glEnable(3G)
and that's the page, bestie! π this was GLCLIPPLANE(3G) in all its glory β official documentation energy, group chat delivery. go clip something cute. bye diva! πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms