我正在尝试将每个顶点颜色的网格导出到 Matlab 中的 VRML 文件(.wrl)。我使用文件交换中的 VRML 功能。我确实得到了模型,但我似乎无法获得正确的颜色。
这是我正在使用的代码:
model=figure();
colormap(hsv(length(handles.p)));
if ~exist('handles.newx')
model=trisurf(handles.tri, handles.p(:,3), handles.p(:,2), handles.p(:,1), abs(handles.pc1co));
else
model=trisurf(handles.tri, newx, newy, newz, abs(handles.factor));
end
modelname = inputdlg('Enter model name: ');
[name path] = uiputfile({'*.wrl'}, 'Save model', [handles.FigPath ,modelname{1}]);
vrml(model,[path,name]);
close(1);
我还附上了出现在 Matlab 图中的模型和实际无色 vrml 模型的图像。
谢谢你的帮助...