3d 坐标 + 阴影 [英] 3d coordinates + shade
问题描述
我正在尝试绘制一个 3D 坐标系 (X,Y,Z),然后我想用某种颜色对这个 3D 坐标系内的一个区域进行着色,例如对以下定义的区域进行着色:
I am trying to plot a 3D coordinate system (X,Y,Z) and then I would like to shade an area within this 3D coordinate system with some color for example shade the following region defined by:
Z>Y>X
有人可以帮忙吗?
我已经完成了以下操作,但似乎不知道如何进行,
I have done the following but cant seem to know how to proceed,
a=0:0.1:10;
b=0:0.1:10;
c=0:0.1:10;
[x,y,z]=meshgrid(a,b,c);
推荐答案
好的,那么您需要能够绘制体积数据.您可以做的最好的事情是下载 vol3d 以实现这一目标.这是一个相当不错的体素可视化工具.
Ok, so you need to be able to plot volumetric data then. The best thing you can do is download vol3d in order to achieve that. Its a quite nice voxel visualizer.
然后:
a=0:0.1:10;
b=0:0.1:10;
c=0:0.1:10;
[x,y,z]=meshgrid(a,b,c);
shaded_area=false(size(x));
% Your rules
shaded_area=y>x; % two ways ;).
shaded_area(z>y)=true;
% Plot it!
vol3d('Cdata',shaded_area);
但是,当您尝试绘制体积布尔数据时,我建议您使用这两个不错的东西以获得更好"的可视化效果,仅此而已.
However, as you are triying to plot volumetric boolean data I suggest you use this couple of nice things in order to get a "nicer" visualization, no more.
vol3d('Cdata',smooth3(uint8(shaded_area),'gaussian'))
axis([0 length(a) 0 length(b) 0 length(c)])
view(122,14)
axis off
这篇关于3d 坐标 + 阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!