代码拉取完成,页面将自动刷新
同步操作将从 王浩赟/使用kinodynamic RRTStar算法规划轨迹 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
function obj = readObj(fname)
%
% obj = readObj(fname)
%
% This function parses wavefront object data
% It reads the mesh vertices, texture coordinates, normal coordinates
% and face definitions(grouped by number of vertices) in a .obj file
%
%
% INPUT: fname - wavefront object file full path
%
% OUTPUT: obj.v - mesh vertices
% : obj.vt - texture coordinates
% : obj.vn - normal coordinates
% : obj.f - face definition assuming faces are made of of 3 vertices
%
% Bernard Abayowa, Tec^Edge
% 11/8/07
% set up field types
v = []; vt = []; vn = []; f.v = []; f.vt = []; f.vn = [];
fid = fopen(fname);
% parse .obj file
while 1
tline = fgetl(fid);
if ~ischar(tline), break, end % exit at end of file
ln = sscanf(tline,'%s',1); % line type
%disp(ln)
switch ln
case 'v' % mesh vertexs
v = [v; sscanf(tline(2:end),'%f')'];
case 'vt' % texture coordinate
vt = [vt; sscanf(tline(3:end),'%f')'];
case 'vn' % normal coordinate
vn = [vn; sscanf(tline(3:end),'%f')'];
case 'f' % face definition
fv = []; fvt = []; fvn = [];
str = textscan(tline(2:end),'%s'); str = str{1};
nf = length(findstr(str{1},'/')); % number of fields with this face vertices
[tok str] = strtok(str,'//'); % vertex only
for k = 1:length(tok) fv = [fv str2num(tok{k})]; end
if (nf > 0)
[tok str] = strtok(str,'//'); % add texture coordinates
for k = 1:length(tok) fvt = [fvt str2num(tok{k})]; end
end
if (nf > 1)
[tok str] = strtok(str,'//'); % add normal coordinates
for k = 1:length(tok) fvn = [fvn str2num(tok{k})]; end
end
f.v = [f.v; fv]; f.vt = [f.vt; fvt]; f.vn = [f.vn; fvn];
end
end
fclose(fid);
% set up matlab object
obj.v = v; obj.vt = vt; obj.vn = vn; obj.f = f;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。