Skip to main content
additional content
Source Link
azdahak
  • 946
  • 5
  • 11

Here's my stab at it, using a cylindrical projection, and TextureCoordinateFunction with a fitting parameter. Replace IMG in the code with the actual photo. The last command is a manual crop.

result=With[{para = 1.69}, 
ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, Pi}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> "Neutral", 
TextureCoordinateFunction -> ({#4, para Tan[#5]} &), 
AspectRatio -> para]]

Show[ImageTrim[Rasterize[result], {{45, 75}, {232, 165}}],AspectRatio->1]

enter image description here

Here's a modified version of the above using a few more control parameters which gives a projection on to a more general elliptical cylinder.It also corrects the lighting.

result = ParametricPlot3D[{Cos[u], .21 Sin[0.9 u], 
v + .08 Sin[u - .05]}, {u, 0, \[Pi]}, {v, 0, 1}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> {{"Ambient", White}}];

Show[ImageTrim[Rasterize[result], {{50, 53}, {320, 120}}], 
AspectRatio -> 1, ImageSize -> 200]

enter image description here

Here's my stab at it, using a cylindrical projection, and TextureCoordinateFunction with a fitting parameter. Replace IMG in the code with the actual photo. The last command is a manual crop.

result=With[{para = 1.69}, 
ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, Pi}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> "Neutral", 
TextureCoordinateFunction -> ({#4, para Tan[#5]} &), 
AspectRatio -> para]]

Show[ImageTrim[Rasterize[result], {{45, 75}, {232, 165}}],AspectRatio->1]

enter image description here

Here's my stab at it, using a cylindrical projection, and TextureCoordinateFunction with a fitting parameter. Replace IMG in the code with the actual photo. The last command is a manual crop.

result=With[{para = 1.69}, 
ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, Pi}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> "Neutral", 
TextureCoordinateFunction -> ({#4, para Tan[#5]} &), 
AspectRatio -> para]]

Show[ImageTrim[Rasterize[result], {{45, 75}, {232, 165}}],AspectRatio->1]

enter image description here

Here's a modified version of the above using a few more control parameters which gives a projection on to a more general elliptical cylinder.It also corrects the lighting.

result = ParametricPlot3D[{Cos[u], .21 Sin[0.9 u], 
v + .08 Sin[u - .05]}, {u, 0, \[Pi]}, {v, 0, 1}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> {{"Ambient", White}}];

Show[ImageTrim[Rasterize[result], {{50, 53}, {320, 120}}], 
AspectRatio -> 1, ImageSize -> 200]

enter image description here

Source Link
azdahak
  • 946
  • 5
  • 11

Here's my stab at it, using a cylindrical projection, and TextureCoordinateFunction with a fitting parameter. Replace IMG in the code with the actual photo. The last command is a manual crop.

result=With[{para = 1.69}, 
ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, Pi}, 
PlotStyle -> Texture[ImageReflect[IMG, Left -> Right]], 
Mesh -> None, PlotRange -> All, ViewPoint -> Front, 
Lighting -> "Neutral", 
TextureCoordinateFunction -> ({#4, para Tan[#5]} &), 
AspectRatio -> para]]

Show[ImageTrim[Rasterize[result], {{45, 75}, {232, 165}}],AspectRatio->1]

enter image description here