MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Best way to draw a raster image onto a curved surface


Here is one way to draw a raster image onto a curved surface:

(* get raster data *)
dat = ExampleData[{"TestImage", "Lena"}, "Data"]/255.;

(* interpolate RGB values *)
rgbinterps = 
 ListInterpolation[#, {{0, 1}, {0, 1}}, InterpolationOrder -> 1] & /@ 
  Transpose[dat, {2, 3, 1}];

ParametricPlot3D[{Sin[x] Cos[y], Sin[x] Sin[y], Cos[x]}, {x, 1, 
  2}, {y, 4, 5}, 
 ColorFunction -> (RGBColor @@ Through[rgbinterps[#4, #5]] &), 
 PlotPoints -> 75, Mesh -> None]

Is there a superior way?



  • Prev by Date: Re: physical constants
  • Next by Date: Re: How much memory is needed?
  • Previous by thread: Re: Strange Manipulate+ContourPlot behavior
  • Next by thread: Row vs. GraphicsRow