The method is called texture mapping. This is a sample code from the surface function (R2011b):
load clown surface(peaks,flipud(X),... 'FaceColor','texturemap',... 'EdgeColor','none',... 'CDataMapping','direct') colormap(map) view(-35,45)
In this example, the RGB image is loaded from "peppers.png" and displayed on the cylinder:
imgRGB = imread('peppers.png'); [imgInd,map] = rgb2ind(imgRGB,256); [imgIndRows,imgIndCols] = size(imgInd); [X,Y,Z] = cylinder(imgIndRows,imgIndCols); surface(X,Y,Z,flipud(imgInd),... 'FaceColor','texturemap',... 'EdgeColor','none',... 'CDataMapping','direct') colormap(map) view(-35,45)
Even easier with the warp function (supplied with image processing tools) as natan :
imgRGB = imread('peppers.png'); [imgRows,imgCols,imgPlanes] = size(imgRGB); [X,Y,Z] = cylinder(imgRows,imgCols); warp(X,Y,Z,imgRGB);