필터 지우기
필터 지우기

Get view of overlapping two 3d surfs

조회 수: 7 (최근 30일)
Ivan Volodin
Ivan Volodin 2017년 3월 11일
댓글: Star Strider 2017년 3월 11일
Hello! I would like to be able to see how two different 3d plots overlapps. The problem is, when I create two different surfs one absorbs another and due to that, it is possible fully to see one figure and partly another. this is the code I am using:
R = 1; %// radius
H = 3; %// height
N = 100; %// number of points to define the circumference
[x, y, z] = cylinder([0 R], N);
[x_,y_,z_] = sphere;
figure;surf(X,Y,Z,'EdgeColor', 'None');hold on;surf(x,y,z);grid on
and get this:
so I can't get information about the cone, where it ends inside of the sphere... I looked up on the internet, but did not find clear solution of the problem. Hope you can help. Thanks in advance!

채택된 답변

Star Strider
Star Strider 2017년 3월 11일
Set the sphere transparency with the 'FaceAlphs' name-value pair, and you can see the cone inside the sphere.
The Code
R = 1; %// radius
H = 3; %// height
N = 100; %// number of points to define the circumference
[x, y, z] = cylinder([0 R], N);
[X,Y,Z] = sphere;
figure
surf(X,Y,Z,'EdgeColor', 'None', 'FaceAlpha',0.8);
hold on
surf(x,y,z)
hold off
grid on
  댓글 수: 2
Ivan Volodin
Ivan Volodin 2017년 3월 11일
Thank you very much! This is exactly what I need
Star Strider
Star Strider 2017년 3월 11일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by