Putting a raster image on a surface

The raster image

If you have a raster image such as an imported JPEG it should work the same way.  I have chosen a small random raster to illustrate the method.

rasterdata  =  
        Table[{Random[], 0, Random[]}, {i, 0, 5}, {j, 0, 10}];

plot21  =  
      Show[Graphics[Raster[rasterdata, ColorFunction  ->  RGBColor]], 
        AspectRatio  ->  Automatic, Axes  ->  True]

Making a color list

This take the data from the raster and turns it into a list of color commands.  (If you are working with an imported JPEG you will have to divide the ordered triples by 255 to normalize them.)

colorlis  =  Apply[RGBColor, rasterdata, {2}];

Now we need our surface.

We cannot apply the color to the surface directly so we create the surface and then apply the color.  Notice I have set the PlotPoints option to correspond to the number of cells in the raster.

plot23  =  
      ParametricPlot3D[{x, y, x^2 + y^2}, {x, 0, 11}, {y, 0, 6}, 
        PlotPoints  ->  {12, 7},  BoxRatios  ->  {6, 3, 2}, 
        ViewPoint -> {-1.868,  -2.324,  1.600}]

Getting the parts

This extracts the polygons from the above plot.  We will take the polygons and assign colors to them with our colorlis.

plotlis24  =  Cases[plot23, _Polygon, Infinity];

A special color function

We will use this functon to take each of the polygons in the above plot and assign the appropriate color to them.

colorfunc[mypoly_Polygon, colorlis_] :=  {EdgeForm[], 
        colorlis[[Apply[Sequence, 
              Reverse[Drop[
                  Ceiling[
                    Apply[Plus, mypoly[[1]]]/
                      Length[mypoly[[1]]]], -1]]]]], 
        mypoly}

Applying the function

newplotlis  =  
        Map[colorfunc[#, colorlis] &, plotlis24];

Our new plot is created by showing the polygons we just generated

plot25  =  
      Show[Graphics3D[newplotlis], BoxRatios  ->  {6, 3, 2}, 
        Lighting  ->  False, 
        ViewPoint -> {0.253,  -2.457,  2.312}]

A comparison

Show[GraphicsArray[{{plot21, plot25}}], 
      ImageSize  -> 540]

Some thoughts

It is important for this that the number of polygons in both plots be the same or you will not have complete images on your surface or you may get error messages when you convert the polygons.  This means that you are not going to be able to control the smoothness of your surface, it is going to depend on the size of your raster.  I have taken the mesh lines off the surface by using EdgeForm[ ] in the color function.  If you want the mesh lines in you can eliminate the EdgeForm[ ] and the color function will still work.