Here's a very simple sample of how to use MeshBuffers, just in case somebody else is trying to figure this out.
' basic Irrlich stuff for setting up the engine
Local device:IrrlichtDevice = ..
IrrlichtDevice.Create(EDT_OPENGL, _DIMENSION2DI(640, 480), 16, False)
If Not device Return
Local Driver:IVideoDriver = device.getVideoDriver()
Local smgr:ISceneManager = device.getSceneManager()
smgr.addCameraSceneNode(Null, _VECTOR3DF(0, 5, - 40), _VECTOR3DF(0, 10, 0))
' the vertex array
Local lVert:S3DVertex[] = New S3DVertex[4]
' setup the array
lVert[0] = S3DVertexDefault.Create()
lVert[1] = S3DVertexDefault.Create()
lVert[2] = S3DVertexDefault.Create()
lVert[3] = S3DVertexDefault.Create()
' only position, color and normals for each vertex
' we don't need texture coordinates this time
lVert[0].setPos(_VECTOR3DF(0, 0, 10))
lVert[0].SetColor(_SCOLOR(255, 0, 255, 255))
lVert[0].setNormal(_VECTOR3DF(1, 1, 0))
lVert[1].setPos(_VECTOR3DF(10, 0, - 10))
lVert[1].SetColor(_SCOLOR(255, 255, 0, 255))
lVert[1].setNormal(_VECTOR3DF(1, 0, 0))
lVert[2].setPos(_VECTOR3DF(0, 20, 0))
lVert[2].SetColor(_SCOLOR(255, 255, 255, 0))
lVert[2].setNormal(_VECTOR3DF(0, 1, 1))
lVert[3].setPos(_VECTOR3DF(- 10, 0, - 10))
lVert[3].SetColor(_SCOLOR(255, 0, 255, 0))
lVert[3].setNormal(_VECTOR3DF(0, 0, 1))
' the index array - creates polygons from our vertex array
Local lInd:Short[] = New Short[9]
lInd[0] = 1 ' equals lVert[1]
lInd[1] = 2 ' equals lVert[2]
lInd[2] = 0 ' equals lVert[0]...
lInd[3] = 3
lInd[4] = 2
lInd[5] = 1
lInd[6] = 0
lInd[7] = 2
lInd[8] = 3
' the mesh buffer
Local lSMB:SMeshBuffer = SMeshBuffer.Create()
' make it use our vertex and index buffers
lSMB.append(lVert, lInd)
lSMB.recalculateBoundingBox()
' the mesh
Local lM:SMesh = SMesh.Create()
' make it use our mesh buffer
lM.addMeshBuffer(lSMB)
lM.recalculateBoundingBox()
' turn off lightning so we can see the colors
lM.setMaterialFlag(EMF_LIGHTING, False)
' the actual scene that connects the mesh to the scene
Local IMSN:IMeshSceneNode = smgr.addMeshSceneNode(lM)
' show debug stuff, that white wireframe cube
IMSN.setDebugDataVisible(True)
Print "sizes of our buffers are:"
Print lSMB.getIndexCount()
Print lSMB.getVertexCount()
Print lM.getMeshBufferCount()
' fancy eye candy - make our mesh rotate!
Local anim:ISceneNodeAnimator = ..
smgr.createRotationAnimator(_VECTOR3DF(0.0, 0.8, 0.0))
IMSN.addAnimator(anim)
' normal sample app logic follows
Local frames:Int=0
While(device.run())
Driver.beginScene(True, True, _SCOLOR(0, 200, 100, 100))
smgr.drawAll()
driver.endScene()
frames:+1
If (frames=100)
Local str:String = "Testi ["
str :+ driver.getName()
str :+ "] FPS: "
str :+ driver.getFPS()
device.setWindowCaption(str)
frames=0
EndIf
Wend
device.drop()