A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: Stretching a grid around a sphere...

Hybrid View

  1. #1
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    a square area with a grid on it when looped horizontally and vertically becomes a torus, and you cant massage that into a sphere.

    http://lab.andre-michelle.com/earth

    that uses a flat bitmap and scrolls it horizontally, looks ok to me.
    lather yourself up with soap - soap arcade

  2. #2
    Quote Originally Posted by mr_malee
    From the comments on that page there was this link with some explanation.
    http://makc.coverthesky.com/FlashFX/ffx.php?id=8
    and here
    http://blog.andre-michelle.com/2005/...mentmapfilter/

  3. #3
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    Quote Originally Posted by mr_malee
    a square area with a grid on it when looped horizontally and vertically becomes a torus, and you cant massage that into a sphere.

    http://lab.andre-michelle.com/earth

    that uses a flat bitmap and scrolls it horizontally, looks ok to me.
    Actually the globe is a perfect example of what he is talking about. A 2D map of the earth surface (like a mercator projection) looks totally different when it's projected onto a sphere. Think how large Antarctica and Greenland look on the 2D map and how small they appear on the real globe - because they are both crowded near a singularity (pole) of the mapping function.

    The globe looks ok in this case, because the original texture is already super distorted to compensate.

    As for the OP, I think the best solution is the distorted cube mesh - you could define a square texture for each of the 6 deformed faces and then subdivide it in texture space to get a a tiny patch of texture mapped out to each tiny patch of sphere surface. Each patch can be filled using beginBitmapFill on two triangular regions and it should look pretty good.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center