필터 지우기
필터 지우기

Problem with Wavefront read_wobj function to read an .obj file into MATLAB

조회 수: 8 (최근 30일)
REZA
REZA 2018년 5월 10일
답변: Ajay Joseph 2021년 1월 25일
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.

답변 (1개)

Ajay Joseph
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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by