Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: World map as Texture
Replies: 2   Last Post: Mar 2, 2013 2:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
psycho_dad

Posts: 64
Registered: 4/28/07
Re: World map as Texture
Posted: Mar 2, 2013 2:34 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
This piece of code will (sort of) do it:

img= Import["path to your image.png"];

SphericalPlot3D[1, {=CE=B8, 0, Pi}, {\[Phi], 0, 2 Pi},
PlotStyle -> Directive[Specularity[White, 30], Texture[img]],
TextureCoordinateScaling -> True,
TextureCoordinateFunction -> ({#4, #5} &), Lighting -> "Neutral",
Mesh -> None, PlotRange -> All]

You can find several free maps in different kinds of projections here:
http://en.wikipedia.org/wiki/Map_projection

The above code has a problem with the TextureCoordinateFunction, ie you need to know the type of projection and then supply the right arguments ({#4, #5} &) otherwise it will look distorted.

Perhaps someone else has a better solution, as I'm quite interested in this myself as well :)

Cheers




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.