Superhypnotic! Thanks for sharing!
The m15 mesh could be also created at run-time, this way:
Function BuildPlane_AsM15(modelSlot As Long, width As Long, height As Long, detailStep As Single)
Long vertexCount = (width / detailStep + 1) * (height / detailStep + 1) * 4
TBGL_m15InitModelBuffers modelSlot, vertexCount
TBGL_m15SetModelVertexcount(modelSlot, vertexCount)
Single x, z
Long index
For x = -width / 2 To width / 2 Step detailStep
For z = -height / 2 To height / 2 Step detailStep
Incr index
TBGL_m15SetVertexXYZ(modelSlot, index, x, 0, z)
Incr index
TBGL_m15SetVertexXYZ(modelSlot, index, x+detailStep, 0, z)
Incr index
TBGL_m15SetVertexXYZ(modelSlot, index, x+detailStep, 0, z+detailStep)
Incr index
TBGL_m15SetVertexXYZ(modelSlot, index, x, 0, z+detailStep)
TBGL_m15SetVertexPStop(modelSlot, index, 1)
Next
Next
TBGL_m15SetVertexRGB(modelSlot, 1, index, 255, 255, 255)
End Function
So, instead of TBGL_m15LoadModel, you just call, for example:
BuildPlane_AsM15(1, 20, 20, 0.5)
Petr
Bookmarks