Skip to content

GetSurface

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

GetSurface

GetSurface:Int32 mesh:Int32, surface_index:Int32
Parameter Mode Type Default Description
mesh In Int32 required Mesh handle.
surface_index In Int32 required Number of the surface, 1 up to the number of surfaces.

Returns: The handle of the surface.

Description

Gets the handle of one surface of a mesh, which you need for every surface command. The index starts at 1, so visit all surfaces with a loop from 1 to CountSurfaces. This is also how you reach the surfaces of a mesh you loaded or of a primitive such as a cube.

Examples

mesh = CreateCube()
For i = 1 To CountSurfaces(mesh)
	surf = GetSurface(mesh, i)
	Print "surface " + i + ": " + CountVertices(surf) + " vertices, " + CountTriangles(surf) + " triangles"
Next

Related Commands

ClearSurface, CreateSurface, FindSurface, PaintSurface

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally