I'm trying to export a mesh with per vertex color to a VRML file (.wrl) in Matlab. Im using the VRML function from file exchange. I do get the model but I cannot seem to be getting the colors right.
This is the code I'm using:
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);
I'm also attaching the model as it appears in the Matlab Figure and an image of the actual colorless vrml model.
Thanks for your help...