三维坐标+遮阳 [英] 3d coordinates + shade
问题描述
我想绘制一个三维坐标系统(X,Y,Z),然后我想树荫此3D之内的区域坐标系有些颜色如灯罩被定义以下区域:
Z> Y> X
任何人都可以请帮助?
我也做了以下,但不能似乎知道如何着手,
A = 0:0.1:10;
B = 0:0.1:10;
C = 0:0.1:10;
[X,Y,Z] = meshgrid(A,B,C);
好了,你需要能够绘制体数据即可。你能做的最好的事情就是下载 vol3d ,以实现这一目标。它是一种相当不错的体素的可视化。
然后:
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(尺寸(X));
%你的规则
shaded_area = Y> X; %两种方式)。
shaded_area(Z> Y)=真;
%绘制它!
vol3d('CDATA',shaded_area);
不过,因为你是triying绘制立体的布尔的数据我建议你用这对夫妻的好东西,为了得到一个更好的可视化,没有更多的。
vol3d('CDATA',smooth3(UINT8(shaded_area),'高斯'))
轴([0长度(A)0长度(B)0长度(C))
视图(122,14)
轴关闭
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
Can anyone please help?
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);
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.
then:
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
这篇关于三维坐标+遮阳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!