Problem with Wavefront read_wobj function to read an .obj file into MATLAB
7 ビュー (過去 30 日間)
古いコメントを表示
I am currently using MATLAB R2017a and have installed the Wavefront toolbox. I run read_wobj function to open a .obj 3D file. But everytime the following message is shown:
Reading Object file : nf_6_new_double.obj
%
% Wavefront OBJ file
% Created in RealityCapture v1.0.3.3939
%www.capturingreality.com
% 2031735 vertices, 4063610 faces
%
Reading Material file : nf_6_new.mtl
%
% Wavefront material file
% Created in RealityCapture v1.0.3.3939
%www.capturingreality.com
%
Finished Reading Material file
Lines processed : 10000
Lines processed : 20000
Lines processed : 30000
Lines processed : 40000
Lines processed : 50000
Lines processed : 2780000
Lines processed : 2790000
Lines processed : 2800000
Lines processed : 2810000
Lines processed : 2820000
Lines processed : 2830000
Field assignment to a non-structure array object.
Error in read_wobj (line 198) objects(no).data.vertices=array_vertices(findex);
Error in Angle_3DF (line 7) OBJ=read_wobj('nf_6_new_double.obj');
Similar problem is mentioned in this link:
https://www.mathworks.com/matlabcentral/answers/300038-has-anyone-tried-to-use-wavefront-read_wobj-function-to-read-an-obj-file-into-matlab
I also tried according to the answers in that link. But still the same. Anyone have a solution for this situation? Thanks in advance.
0 件のコメント
回答 (1 件)
Ajay Joseph
2021 年 1 月 25 日
Dont use read_wobj() use readobj(). It take a little longer to extract the data. Once the obj data is extracted using readobj(). I saved the file as a mat file to matlab's current folder using save('OBJ'). If you manage to save it then use the following to read vertices and faces.
load (OBJ.mat)
Vert = OBJ.v;
Fac = OBJ.f.v;
Happy days
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!