in the previous example i was not able to make a hole in the middle of the green board correctly
here is a way to make a hole inside a mesh correctly
we use custom mesh made from adjacent independent triangles, so we can erase any triangle without affecting the others.
it is made from 18 triangles and the numbering of indexes for triangle 1 is
index 0 have coordinates 0,3,0
index 1 have coordinates 1,2,0
index 2 have coordinates 1,3,0
index 3 is for triangle 2 and begins with 0,3,0
look the figure below (not showing z coordinate because it is all 0)
(remember the triangle corners are corner 0, corner 1, corner 2)
when we want to delete triangle 9 we change the coordinates of corner 1 of the triangle 9 which have index 25 like this:
MP_VertexSetX(Mesh,25,2)
MP_VertexSetY(Mesh,25,2)
MP_VertexSetZ(Mesh,25,0)
ie we give it the coordinates of the triangle 9 corner 2 (index 26)
you can add more to MP_AddVertex such as MP_AddVertex(Entity, x.f, y.f, z.f [, Color [, u.f, v.f [, nx.f, ny.f, nz.f]]]) look docs
look example MP_UseVertex.pb in Mesh folder to see how to texture a mesh made using MP_AddVertex + MP_AddTriangle

click the mouse in the middle of the green board and you can erase triangles in the middle and the light will pass through it.

Code:
;depends on MP_PickingTriangle.pb and MP_ChessShadow MP3D examples
Global xres=800, yres=600
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "mesh eating, tearing and shadow, click on the green board to tear it")
camera=MP_CreateCamera()
light=MP_CreateLight(0)
MP_InitShadow()
Width=256
Height=256
;to make a background with gradient color
If CreateImage(0, Width, Height)
MP_CreateImageColored(0, 0, RGB(0,255,255), RGB(0,255,255), RGB(200,0,255), RGB(200,0,255))
EndIf
Surface = MP_ImageToSurface(0,0)
FreeImage(0)
MP_SurfaceSetPosition(Surface,0,0,1)
MP_SurfaceDestRect(Surface,0, 0, xres, yres)
texture = MP_CreateTextureColor(256, 256, RGBA(0, 255, 0, 0))
texture2 = MP_CreateTextureColor(256, 256, RGBA(0, 255, 255, 0))
texture3 = MP_CreateTextureColor(256, 256, RGBA(0, 0, 255, 255))
cone = MP_CreateCone(64, 10)
MP_EntitySetTexture(cone, texture2)
MP_PositionEntity(cone, 0, 2, 0)
MP_ScaleMesh(cone, 0.5, 0.5, 0.5)
MP_RotateEntity(cone, 0, 90, 0)
plane = MP_CreateMesh() ;the plane we want to make holes
plane2 = MP_CreatePlane(10, 10)
MP_EntitySetTexture(plane2, texture3)
MP_RotateEntity(plane2, 0, 90, 90)
cam0 = MP_CreateCamera()
MP_PositionCamera(cam0, -150, 90, -140)
MP_RotateCamera(cam0, 47, 0, -30)
MP_PositionEntity(light, 0, 20, 20)
MP_EntityLookAt(light,0,0,0)
;;00000000000000000000000000000000000000000000000000000
; constructing the green board
i.l:j.l:vtx.l=-1:t1.f=0:t2.f=0:t3.f=0
Restore Vertices
For i=0 To 17
vtx + 1 ; corner 0 of every triangle
For j=0 To 2
Read.f t1 : Read.f t2 : Read.f t3
MP_AddVertex(plane,t1, t2, t3)
Next j
MP_AddTriangle (plane, vtx,vtx+1,vtx+2)
vtx+2
Next i
MP_ScaleMesh(plane, 2.5, 2.5, 2.5)
MP_EntitySetTexture(plane, texture)
MP_PositionEntity (plane,-3,0,0)
;-00000000000000000000000000000000000000000000000000000
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
count.f + 0.01
MP_PositionEntity(light, Sin(count+#PI/2) * 10 , 20, Cos(count+#PI/2) * 10)
MP_EntityLookAt(light,MP_EntityGetX(plane),MP_EntityGetY(plane),MP_EntityGetZ(plane))
MP_PositionCamera (Camera, 10, 5, 6)
MP_CameraLookAt(Camera,MP_EntityGetX(plane),MP_EntityGetY(plane),MP_EntityGetZ(plane))
;;0000000000000000000000000000000000000000000000000000
If MP_MouseButtonDown(0)
pickedmesh = MP_PickCamera(cam0, WindowMouseX(0),WindowMouseY(0))
triangleindex = MP_PickedGetTriangle();
If triangleindex And pickedmesh = plane
index0 = MP_EntityGetTriangle(pickedmesh, triangleindex, 0)
index1 = MP_EntityGetTriangle(pickedmesh, triangleindex, 1)
index2 = MP_EntityGetTriangle(pickedmesh, triangleindex, 2)
x1.f=MP_VertexGetX(pickedmesh, index1)
y1.f=MP_VertexGetY(pickedmesh, index1)
z1.f=MP_VertexGetZ(pickedmesh, index1)
x2.f=MP_VertexGetX(pickedmesh, index2)
y2.f=MP_VertexGetY(pickedmesh, index2)
z2.f=MP_VertexGetZ(pickedmesh, index2)
; reset the vertex1 coordinates the same as vertex2
MP_VertexSetX(plane,index1,x2)
MP_VertexSetY(plane,index1,y2)
MP_VertexSetZ(plane,index1,z2)
EndIf
EndIf
;;;00000000000000000000000000000000000000000000000000000
MP_RenderWorld()
MP_Flip ()
Wend
DataSection
Vertices:
Data.f 0,3,0
Data.f 1,2,0
Data.f 1,3,0
Data.f 0,3,0
Data.f 0,2,0
Data.f 1,2,0
Data.f 1,3,0
Data.f 2,2,0
Data.f 2,3,0
Data.f 1,3,0
Data.f 1,2,0
Data.f 2,2,0
Data.f 2,3,0
Data.f 3,2,0
Data.f 3,3,0
Data.f 2,3,0
Data.f 2,2,0
Data.f 3,2,0
Data.f 0,2,0
Data.f 1,1,0
Data.f 1,2,0
Data.f 0,2,0
Data.f 0,1,0
Data.f 1,1,0
Data.f 1,2,0
Data.f 2,1,0
Data.f 2,2,0
Data.f 1,2,0
Data.f 1,1,0
Data.f 2,1,0
Data.f 2,2,0
Data.f 3,1,0
Data.f 3,2,0
Data.f 2,2,0
Data.f 2,1,0
Data.f 3,1,0
Data.f 0,1,0
Data.f 1,0,0
Data.f 1,1,0
Data.f 0,1,0
Data.f 0,0,0
Data.f 1,0,0
Data.f 1,1,0
Data.f 2,0,0
Data.f 2,1,0
Data.f 1,1,0
Data.f 1,0,0
Data.f 2,0,0
Data.f 2,1,0
Data.f 3,0,0
Data.f 3,1,0
Data.f 2,1,0
Data.f 2,0,0
Data.f 3,0,0
EndDataSection