Skip to content

SetCameraClipPlane

Narta Xaymar Dirks edited this page Nov 25, 2026 · 2 revisions

SetCameraClipPlane

SetCameraClipPlane:Void camera:Int32, index:Int32, a:Float32, b:Float32, c:Float32, d:Float32
Parameter Mode Type Default Description
camera In Int32 required Camera handle.
index In Int32 required Which plane, from 0 to 5.
a In Float32 required The X of the normal.
b In Float32 required The Y of the normal.
c In Float32 required The Z of the normal.
d In Float32 required How far the plane is moved along the normal.

Description

Sets one of the 6 clip planes of a camera. While the plane is on, the camera cuts away everything that lies behind it: every point where a*x + b*y + c*z + d is below 0. The plane is in the world, so it stays where it is when the camera moves. A new plane is off; turn it on with SetCameraClipPlaneEnabled. This is a BlitzLLVM extension.

a, b and c are the normal of the plane, which points to the side that is kept, and d moves the plane: a plane through the point p with the normal n has d = -(n.x*p.x + n.y*p.y + n.z*p.z). The normal does not have to be one long.

Clip planes cut the triangles of the world for this camera only. They are meant for things like a water surface or a mirror, where the picture must not show what is below or behind it. Picking, culling and collisions do not use them.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
sphere = CreateSphere(16)
PositionEntity sphere, 0, 0, 5
; Keep only what is above Y = 0: the lower half of the sphere goes away.
SetCameraClipPlane camera, 0, 0, 1, 0, 0
SetCameraClipPlaneEnabled camera, 0, True
RenderWorld
Flip

Related Commands

GetCameraClipPlane, GetCameraClipPlaneEnabled, SetCameraBuffer, SetCameraClipPlaneEnabled, SetCameraProjectionMatrix, SetCameraStencil, SetCameraStencilClear, SetCameraViewMatrix

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally