Skip to content

ClearSurface

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
Blitz3D

ClearSurface

ClearSurface:Void surface:Int32, clear_vertices:Int32=1, clear_triangles:Int32=1
Parameter Mode Type Default Description
surface In Int32 required Surface handle.
clear_vertices In Int32 1 1 to remove the vertices. Defaults to 1.
clear_triangles In Int32 1 1 to remove the triangles. Defaults to 1.

Description

Removes the vertices, the triangles or both from a surface. The surface itself stays, ready to receive new geometry. Together with AddVertex this is the way to rebuild a mesh every frame or to switch to a different level of detail. If you remove only the vertices, remove the triangles as well, since they point at the vertices.

Examples

mesh = CreateMesh()
surf = CreateSurface(mesh)
a = AddVertex(surf, 0, 0, 0)
b = AddVertex(surf, 0, 1, 0)
c = AddVertex(surf, 1, 0, 0)
AddTriangle surf, a, b, c
Print CountVertices(surf) + " vertices, " + CountTriangles(surf) + " triangles"
ClearSurface surf
Print CountVertices(surf) + " vertices, " + CountTriangles(surf) + " triangles"

Related Commands

CreateSurface, FindSurface, GetSurface, PaintSurface

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally