Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

How to do 3D visualization of a multi-object volume, each object with different colors?

3 views (last 30 days)
I have already visualize a volume, that only have one object, by the following commands:
v = smooth3(vv,'box',3); % vv:volume
hpatch=patch(isosurface(v,0.5),'FaceColor',[1.0000 0.7109 0.7539],...
'EdgeColor','none',...
'AmbientStrength',.2,...
'SpecularStrength',.7,...
'DiffuseStrength',.4);
isonormals(v,hpatch)
%set(hpatch,'FaceColor',[0.2 1 0.7],'EdgeColor','none')
daspect([1,1,0.5])
view([-45,20])
axis tight
camlight right;
camlight left;
set(gcf,'Renderer','zbuffer'); lighting phong
Now I have a volume with 5 value (0:background,1:obj1, 2:obj2, 3:obj3, 4:obj4), I want to visualize each object with different colors in one view, for example:obj1 with yellow color, obj2 with green color and blah blah. How can I extend the code for multi-object 3D visualization?
Your help is appreciated

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!