在MATLAB中建立一个脚本show3Dtxt.m文件,编写代码:

clear;  
%%read 3D data
fileID= fopen('E:\博士\深度学习与三维重建\代码实现\voxel_grids_64\chair_0890_0_0_1_062_049_042.txt','r');  
%txt文件读成三维元胞数组cell形式
A = textscan(fileID,'%d %d %d'); 
%X,Y,Z数据类型均为 1*1 cell
X=A(:,1);  
Y=A(:,2);  
Z=A(:,3);
%将元胞数组转化为矩阵形式
x=cell2mat(X);  
y=cell2mat(Y);  
z=cell2mat(Z);  
%%show 3D data 
plot3(x,y,z,'ro'); %红色圆点 
xlabel('x轴'),ylabel('y轴'),zlabel('z轴')  
grid on  

  运行代码:

MATLAB:读取txt文件中物体的三维坐标,显示三维模型

    备注:voxel_grids_64\chair_0890_0_0_1_062_049_042.txt:

MATLAB:读取txt文件中物体的三维坐标,显示三维模型

 

相关文章:

  • 2021-12-14
  • 2021-09-02
  • 2021-11-11
  • 2021-11-17
  • 2021-12-27
  • 2021-10-03
  • 2021-03-30
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2021-11-18
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案