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