# How can I put an image on a surface [duplicate]

I want to paste an image on the surface of a 3D plot. For example consider this image which I want to paste on the surface of this sphere

ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Mesh -> 1]


What will be the best way to do that?

## EDIT and Clarification

My main objective is not to make a globe but to find a general way to use any arbitrary image on a surface. I choose the map and sphere just as an example (a popular one). Texture is a good option, but I find some difficulty to use it with ContourPlot3D or Plot3D. To make my point clear, I would request to show me an example with this image and the following surface,

Plot3D[Abs[x y], {x, -1, 1}, {y, -1, 1}]

• This should probably do it. Jun 23 '13 at 21:17
• Look up Texture in Mathematica's document center. There are several examples that do precisely this. Jun 23 '13 at 21:27
• Jun 23 '13 at 21:29
• Come on, just do exactly the same thing: Plot3D[Abs[x y], {x, -1, 1}, {y, -1, 1}, PlotStyle -> Texture[Import["http://i.stack.imgur.com/XVgk0.jpg"]], Lighting -> "Neutral"]
– user484
Jun 23 '13 at 22:52

This question is very similar to How to make a 3D globe. There is some difference, as that question dealt with building a globe from scratch, whereas this question has a predefined image. There is a little difference in that you'll need to manually trim the boundary of your image. Here's how did it:

pic = Import["http://i.stack.imgur.com/5JpK4.jpg"];
{width, height} = ImageDimensions[pic];
w = 40; h = 45;
pic = ImageTake[pic, {h, height - h}, {w, width - w}];
ParametricPlot3D[{Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]} ,
{u, 0, 2 Pi}, {v, 0, Pi}, Mesh -> None, PlotPoints -> 100,
TextureCoordinateFunction -> ({#4, 1 - #5} &), Boxed -> False,
PlotStyle -> Texture[Show[pic, ImageSize -> 1000]],
Lighting -> "Neutral", Axes -> False, RotationAction -> "Clip",
ViewPoint -> {-2.026774, 2.07922, 1.73753418},
ImageSize -> 600] • @smtg using Mark McClure's answer to fulfill your requirements in the Edit/Clarification: Plot3D[Abs[x y], {x, -1, 1}, {y, -1, 1}, TextureCoordinateFunction -> ({#1, 1 - #2} &), PlotStyle -> Texture[Show[pic, ImageSize -> 1000]], Lighting -> "Neutral", Mesh -> False] The only difference is in the TextureCoordinateFunction. Jun 24 '13 at 12:53

You could use ContourPlot3D, but I'd use SphericalPlot3D instead. That's because you're plotting a spere anyways and SphericalPlot3D seems to be the better functionality on that matter.

I leave the rest of the options such as in your example for ContourPlot3D.

SphericalPlot3D[1, {u, 0, Pi}, {v, 0, 2 Pi}, PlotPoints -> 50,
MaxRecursion -> 0, Mesh -> True,
TextureCoordinateFunction -> ({#5, 1 - #4} &),
PlotStyle ->
Directive[Texture[Import["http://i.stack.imgur.com/5JpK4.jpg"]],
Specularity[White, 50]], Lighting -> "Neutral"]


Personally I'd remove any mesh, axis and boxes, but this is just a matter of taste. 