Skip to content

AddMesh

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

AddMesh

AddMesh:Void source_mesh:Int32, dest_mesh:Int32
Parameter Mode Type Default Description
source_mesh In Int32 required Mesh that is copied into the other.
dest_mesh In Int32 required Mesh that receives the surfaces.

Description

Appends all surfaces of one mesh to another mesh. This is the way to merge many small models into one, which draws much faster than many entities. The source mesh stays as it is and can be freed afterwards.

Position, rotate and scale the source with the mesh commands, PositionMesh, RotateMesh and ScaleMesh, before adding it. The entity commands move the entity, not its vertices, so AddMesh would ignore them. The mesh commands all work around the origin, so scale and rotate before you move.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 1.2, -4
RotateEntity camera, 10, 0, 0
light = CreateLight()
RotateEntity light, 45, 45, 0
; Build one wall out of 5 boxes.
wall = CreateMesh()
For i = 0 To 4
	brick = CreateCube()
	ScaleMesh brick, 0.47, 0.3, 0.3
	PositionMesh brick, i - 2, (i Mod 2) * 0.1, 0
	AddMesh brick, wall
	FreeEntity brick
Next
EntityColor wall, 200, 110, 70
RenderWorld
Flip
WaitKey

Media

AddMesh

Related Commands

CopyMesh, CreateMesh, FitMesh, FlipMesh, LoadAnimMesh, LoadMesh, PaintMesh, PositionMesh

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally