Heres a little checkered map maker I made to test out my pathfinding routine. The maximum map size is 170x170 which creates a map of 85 tiles x 85 tiles due to the vertice per surface limit.
Graphics3D 800,600,16,2 SetBuffer BackBuffer() Global fpstime,fpscount,FPS ;170X170 IS THE MAX DUE TO VERTICE LIMITATIONS Global MapX = 170 Global MapZ = 170 Dim Vert%(8) Dim Tri%(7) Global Mesh% Global Surf% Global Cam = CreateCamera() PositionEntity Cam,MapX/2,MapX,MapZ/2 Global Lite = CreateLight() PositionEntity Lite,MapX/2,MapX,MapZ/2 Sphere = CreateSphere() PositionEntity Sphere,MapX/2,1,MapZ/2 PointEntity Cam,Sphere Global Map = CreateGrid() CameraClsColor Cam,255,0,0 HideEntity Sphere While Not KeyHit(1) Cls If KeyHit(17) If w = 0 Then WireFrame True w = 1 Else WireFrame False w = 0 EndIf EndIf RenderWorld() UpdateWorld() FPS() Text 10,30,"Verts: "+CountVertices(Surf) Text 10,50,"Tris: "+CountTriangles(Surf) Flip False Wend ClearWorld() End() Function CreateGrid() Mesh = CreateMesh() Surf = CreateSurface(Mesh) EntityFX Mesh,2+1 For z = 0 To MapZ-1 Step 2 ;THIS WILL STAGGER THE COLORS FOR Z If b = 2 Then a = 2 b = 0 Else a = 0 b = 2 EndIf For x = 0 To MapX-1 Step 2 ;THIS WILL STAGGER THE COLORS FOR X If a = 2 Then CreateTile(Surf,x,z,255,255,255,255) a = 0 Else CreateTile(Surf,x,z,5,5,5,255) a = 2 EndIf Next Next Return Mesh End Function Function CreateTile(surf%, x%, z%, r%, g%, b%, a%) a = 0 For Col% = z To z+2 For Row% = x To x+2 Vert(a) = AddVertex(surf,Row,0,Col) VertexColor surf, Vert(a),r,g,b,a a = a + 1 Next Next Tri(0) = AddTriangle(surf,Vert(0),Vert(3),Vert(1)) : Tri(1) = AddTriangle(surf,Vert(1),Vert(3),Vert(4)) Tri(2) = AddTriangle(surf,Vert(1),Vert(4),Vert(2)) : Tri(3) = AddTriangle(surf,Vert(2),Vert(4),Vert(5)) Tri(4) = AddTriangle(surf,Vert(3),Vert(6),Vert(4)) : Tri(5) = AddTriangle(surf,Vert(4),Vert(6),Vert(7)) Tri(6) = AddTriangle(surf,Vert(4),Vert(7),Vert(5)) : Tri(7) = AddTriangle(surf,Vert(5),Vert(7),Vert(8)) End Function Function FPS() fpscount=fpscount+1 If MilliSecs()>fpstime Then fpstime=MilliSecs()+1000 FPS=fpscount fpscount=0 EndIf Text 10,0,"FPS: "+FPS End Function