matlab用plot三点画圆,在MATLAB中使用plot3绘制圆锥

I'm looking for a way to draw a cone at a specific location in a 3D surf plot. Would it also be possible to have the cone 50% transparent?

Right now I'm drawing a basic 3d environment using the surf function. I'm trying to use the function plot3 to draw a cone with specific dimensions at a specific location.

解决方案

The following code creates a cone by pinching a cylinder between zero and one with t=[0;1]. The alpha(...) function fan then be used to set the transparency. To reposition a cylinder you must add a value to the x,y, or z or perform a rotation (beyond the scope of this answer).

t = [0;1];

[X,Y,Z] = cylinder(t);

figure;

clf;

surf(X,Y,Z);

alpha(.5)

hold all

surf(X+1,Y,Z);

alpha(.5);

axis equal

d9946f033e0b3d36f7a94f47b97d1b09.png

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值