Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: How to progressively map a plane to a semisphere?

  1. #11

    Post

    yes in small changes ! as for a animation (and also for animation)

    i have already a code for get to the original to the image to the right, but i can not imagine how to achieve the in between transformation, all the small changes from normal to
    semi spherical

  2. #12
    NymTevlyn
    Guest

    Default

    Photoshop > Filter > Distort (I think...) > Spherize =)

    At least, that's the easy way. Dunno if there's anything at all like that already in GIMP.

  3. #13

    Default

    If a point has initial position (x0, y0) and final position (x1, y1), you could try just parameterizing the line segment between them.

    Let x(t) = x0 + (x1 - x0) t, and y(t) = y0 + (y1 - y0) t. Then as t varies from 0 to 1, (x,y) varies from (x0,y0) to (x1,y1). If you want N steps, generate frames for t = 0, 1/N, 2/N, ..., 1.
    Last edited by isomage; 05-02-2009 at 06:39 PM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  4. #14

    Default

    For an animation I'd definitely use the spherise filter in photoshop as Nym said. I tried it to begin with but it didn't map the corners of the perimeter of the square to the perimeter of the circle (which is what I thought was wanted), so I went down the UV mapping route.

    If want you want to do is an animation and are not too particular about the distortion, then go for spherise in stages saving each image as you go along and increasing the slider a notch, but note the image will still be square with a 'pushed out' sphere in the centre. You'd probably also have to do a warp too to make it move from a square to a circle in shape.

    Isomage, when I was taking A level maths, I remember thinking what on earth I'd ever need those skills for in later life. Now I know, but I've forgotten it all!

  5. #15
    Community Leader Facebook Connected Ascension's Avatar
    Join Date
    Jun 2008
    Location
    St. Charles, Missouri, United States
    Posts
    8,392

    Post

    I think one of the Adobe programs (Elements or After Effects, not sure but I think the latter) can save an image consisting of many layers as an animated gif. That way you could do the Spherize in increments and put each version on its own layer.
    If the radiance of a thousand suns was to burst at once into the sky, that would be like the splendor of the Mighty One...I am become Death, the Shatterer of worlds.
    -J. Robert Oppenheimer (father of the atom bomb) alluding to The Bhagavad Gita (Chapter 11, Verse 32)


    My Maps ~ My Brushes ~ My Tutorials ~ My Challenge Maps

  6. #16

    Post

    Quote Originally Posted by PhotoComix View Post
    Code:
    xprime=x/sqrt(1-4*(y/H)*(y/H));
    yprime=y/sqrt(1-4*(x/W)*(x/W));
    Are you sure about that transformation? If I apply that to each pixel in your image, I get this:
    Attached Images Attached Images
    Last edited by isomage; 05-02-2009 at 07:58 PM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  7. #17

  8. #18

    Post

    Quote Originally Posted by PhotoComix View Post
    I failed to find the discussion on the formula to be applied but if may help i have as Mathmap code
    Code:
    filter rel2ellv3(image in)
    xprime=x/sqrt(1-4*(y/H)*(y/H));
    yprime=y/sqrt(1-4*(x/W)*(x/W));
    in(xy:[xprime,yprime])
    end
    I've just had a brief look at mathmap's documentation and examples, and it appears to be able to do animations; as far as I can tell, if you use a "t" parameter it will automatically generate an animated gif (see http://www.complang.tuwien.ac.at/sch...map/anims.html and http://www.complang.tuwien.ac.at/sch...tml#animations). So assuming your xprime, yprime transformations work correctly in mathmap to give your final image, then I'd guess you might be able to get your desired animation with this:

    Code:
    filter rel2ellv3(image in)
    xprime=x/sqrt(1-4*(y/H)*(y/H));
    yprime=y/sqrt(1-4*(x/W)*(x/W));
    in(xy:[x+t*(xprime-x),y+t*(yprime-y)])
    end
    I haven't tried it, though.
    Last edited by isomage; 05-02-2009 at 10:00 PM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  9. #19

    Post

    Quote Originally Posted by isomage View Post
    Code:
    filter rel2ellv3(image in)
    xprime=x/sqrt(1-4*(y/H)*(y/H));
    yprime=y/sqrt(1-4*(x/W)*(x/W));
    in(xy:[x+t*(xprime-x),y+t*(yprime-y)])
    end
    I haven't tried it, though.
    I tried it. works brilliantly!

    Good job.

    -Rob A>

  10. #20

    Post

    filter rel2ellv3(image in)
    xprime=x/sqrt(1-4*(y/H)*(y/H));
    yprime=y/sqrt(1-4*(x/W)*(x/W));
    in(xy:[x+t*(xprime-x),y+t*(yprime-y)])
    end

    I haven't tried it, though.
    @Isomage

    I did try...perfect ! ...exactly what i was looking for, thank a lot (and thanks for all the other contribute )

    PS the image you posted as example was strange but the code work well !

    ###############################

    About animation gif has to low quality for my taste, but gimp (with a AVI plugin, or with GAP ) may save as uncompressed AVI, then is quite simple apply a codec to shrink the file size or convert to FLV
    Last edited by PhotoComix; 05-04-2009 at 04:06 AM.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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