Reputation: 21
I want to plot a round png picture with alpha-channel in 3D plot. I'm searching for three days without success... I need help!
THANKS! - dwn
Upvotes: 0
Views: 4211
Reputation: 835
The simplest way is to create a surface with a texture map. You'd do something like this:
surface(1:2, 1:2, zeros(2), img, ...
'FaceColor','texturemap','EdgeColor','none');
What's going on here is that those 1:2 arguments are the X & Y coordinates of the corners of your 3D image. The zeros(2) argument is the Z coordinates of your 3D image. You can put different values in there to move the image around in 3D, but you want to create a surface with 4 vertices.
The img argument is your color data. Setting the FaceColor property to texturemap tells the surface to paste the texture onto the surface you created. The last bit just turns off the border.
Upvotes: 3