I’ve done this several time with seabed scans around oil rigs.
Rather than try to create a mesh from the points, it’s easier to create a flat mesh by hand of the correct size and with the correct number of x and y co-ordinates and then use maxscript to move the verts up or down to the right position.
You need to look at the data in a spreadsheet and work out the size of the scanned area and the spacing of the x,y data. Create a flat mesh of the correct size which has the same number of vertices as lines of data. Once you’ve done this you no longer need the xy data in the spread sheet just the z value and the order that the data is listed in.
Have a look at your data it’ll probably start in one corner and the list of co-ordinates will run row by row until you reach the opposite corner. The Vertex numbers of the mesh work the same way. Edit the data in a spreadsheet so that you have 2 columns, the first is the vertex number the second is the z value.(this is not easy, and you’ll need to fiddle around with the data untill you get it in a form you can use). The resultant file will look a bit like this:
Then all you need to do is write a script that will read the first value in the text file and move the first vertex of your mesh to that position, then repeat a million or so times (it dosn’t take that long).
Here is the script that I used (I AM NO GOOD AT MAXSCRIPT!!) it’s as rough as a badgers arse but it worked, I’m sure that there are things in there that could be much better, for example the names of the mesh and the text filename are hard coded as I don’t know how to code file open boxes or object selectors.
global myobj = $seabed_4
global myvert = [0.0, 0.0]
global xRead = 0
global zRead = 0
my_filename = “part4_text_data.csv”
myfile = openfile my_filename
while (not eof myfile) do
xRead = readvalue myfile
– this is the vert number
zRead = readvalue myfile
-- this is the z value or height
myvert = xRead
myVertpos = getvert myobj myvert
myVertpos.z = zread
setVert myobj myvert myVertpos
-- set z position vert
It may well be that you have far too much data to handle in one lump in which case just cut it up into strips and weld it all together afterwards.
I’ve no idea how to set the vertex colours but once you get the mesh created I’m sure a similar technique would work.