I haven't completed a full project yet and I am not working on a FPS but I made this a long time ago to test with and you are welcome to it. I don't know if Blitz3D makes an infinite plane, but you could certainly scale this up to a huge size or tile many of them.
Function CreatePlane:TMesh(parent_ent:TEntity=Null)
Local mesh:TMesh=TMesh.CreateMesh(parent_ent)
Local surf:TSurface=mesh.CreateSurface()
surf.AddVertex(-1.0,-1.0,0.0)
surf.AddVertex(-1.0, 1.0,0.0)
surf.AddVertex( 1.0, 1.0,0.0)
surf.AddVertex( 1.0,-1.0,0.0)
surf.VertexTexCoords(0,0.0,1.0)
surf.VertexTexCoords(1,0.0,0.0)
surf.VertexTexCoords(2,1.0,0.0)
surf.VertexTexCoords(3,1.0,1.0)
surf.AddTriangle(0,1,2) ' front
surf.AddTriangle(0,2,3)
surf.AddTriangle(3,2,0) ' back
surf.AddTriangle(2,1,0) ' Reveresed direction on the vertex list for the triangle to make it show when the backside is towards the camera.
mesh.UpdateNormals()
Return mesh
End Function
|