command warp
has an example showing how to print an custom impage on an arbitrary surface, have a look here
This is the example :
1.- Load the custom image
[I,map] = imread('custom_image.tif');
These are all the image formats that can be loaded with imread
.bmp
.jpeg
.png
.cur
.ppm
.gif
.pbm
.ras
.hdf4
.pcx
.tiff
.ico
.pgm
.xwd
imread
further details available here
2.- Define the surface
[X,Y] = meshgrid(-100:100,-80:80);
Z = -(X.^2 + Y.^2);
3.- Print any image on any surface generated with warp
figure
warp(X,Y,Z,I,map);
4.- Print any image on any surface generated with surf
I2=imread('forest2.jpg');
figure
imshow(I2)
I3r=imresize(I2(:,:,1),size(X));
I3g=imresize(I2(:,:,2),size(X));
I3b=imresize(I2(:,:,3),size(X));
I3=zeros([size(X) 3]);
I3(:,:,1)=I3r;I3(:,:,2)=I3g;I3(:,:,3)=I3b;
I3=uint8(I3);
I3map=[I3r(:) I3g(:) I3b(:)];
figure
hs=surf(X,Y,Z)
hs.EdgeColor='none'
hs.CData=I3
5.- How to define planes in MATLAB
Read my answer here to a question how to define planes. You will learn :
how to define the plane containing all 3 points
how to define planes including any of 2 of the 3 input points
how to define the perpendicular plane including 2 of the 3 input points, and
how to define any of the possible perpendicular planes including 1 of the input points