I used the provided codes for generate .dat file, but then the surface reconstruction based on this dat file was totally wrong.
Then I noticed you wrote: "Points are stored this way: X1,Y1,Z1,X2,Y2,Z2……", however, if the point cloud in matlab is stored in a N x 3 matrix, like below:
using this line "fwrite(fid,p,'double');%points;" to write, the points will be stored in this way: X1,X2,X3...., XN, Y1,Y2,Y3,...,YN, ..., Z1,Z2,Z3,...ZN, because Matlab read p(:) along the column by column, not row by row.
I just changed the line "fwrite(fid,p,'double');%points;" -> "fwrite(fid,p','double');%points;" everything works fine now.
I used the provided codes for generate .dat file, but then the surface reconstruction based on this dat file was totally wrong.
Then I noticed you wrote: "Points are stored this way: X1,Y1,Z1,X2,Y2,Z2……", however, if the point cloud in matlab is stored in a N x 3 matrix, like below:
p = 0,060649 0,011160 0,059552 0,060351 0,012167 0,058159 0,060749 0,012164 0,059571 0,060267 0,011162 0,058137 0,060278 0,013168 0,058137 0,060653 0,013164 0,059557
using this line "fwrite(fid,p,'double');%points;" to write, the points will be stored in this way: X1,X2,X3...., XN, Y1,Y2,Y3,...,YN, ..., Z1,Z2,Z3,...ZN, because Matlab read p(:) along the column by column, not row by row.
I just changed the line "fwrite(fid,p,'double');%points;" -> "fwrite(fid,p','double');%points;" everything works fine now.