Transform a circle to a square? - Graphics

This is a discussion on Transform a circle to a square? - Graphics ; Quick non-GIMP background: I'm trying to create realistic bubbles in second life, and in doing so I wish to map a transparency mask created from an actual bubble image to a second life sphere object. Unfortunately the mask is circular, ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Transform a circle to a square?

  1. Default Transform a circle to a square?

    Quick non-GIMP background:

    I'm trying to create realistic bubbles in second life, and in doing so
    I wish to map a transparency mask created from an actual bubble image
    to a second life sphere object. Unfortunately the mask is circular,
    while the second life texture mapping logic requires a rectangular map
    or else there'd be a gap when the sphere object is actually rendered in
    second life - it comes out looking like a round christmas bell instead
    of a smooth sphere.

    GIMP specific:

    I want to transform a two dimensional circle into a two dimensional
    square. Everything I wish to do within GIMP is strictly 2 dimensional
    mapping - so "map to sphere" or anything like that wouldn't be useful
    for what I need to do. It's the literal round peg into a square hole
    metaphor.

    I've looked at polar distortion and my version of GIMP (picked up a
    month ago) doesn't have the "polar to rectangle" option (don't know why
    and don't know if that would work but it looks like it might) and I've
    browsed through all the various distortion and rendor options that come
    with the standard windows self-installer.

    Hope someone can help, thankyou.


  2. Default Re: Transform a circle to a square?

    OK, a little more looking around shows me that Mathmap would be a good
    plugin to get, only problem is I run Windows XP (Linux has always been
    a "one of these days" things that flat out ran out of days). Is there a
    Windows executable compiled to 2.2 handy anywhere? Installing Cygwin
    and compiling the source could be either a fun or a frustrating
    Saturday afternoon project, but I'd like to spare the time if at all
    possible. Someone posted a bunch of scripts for it recently that
    included exactly the one I needed - circle to square - so no problem
    finding the script for that specific transformation.

    Also - are there any other graphic software packages out there that are
    pretty decent at map transformations? I seem to recall PSP had that in
    spades, but I lost my 5.0 copy and don't feel the ambition to spend $70
    for a new copy...but it seems like the kind of thing there would be
    software out there for. Would there be free/cheap adobe plugin
    compatible with GIMP maybe?

    Thanks again, all.


  3. Default Re: Transform a circle to a square?

    haverber@visi.com wrote:
    Quick non-GIMP background:

    > I'm trying to create realistic bubbles in second life <snip>

    ....oh ? Interesting... err... what does that mean ? :-)

    > ...and in doing so I wish to map a transparency mask created
    > from an actual bubble image to a second life sphere object <snip>

    ....ahhh... seems you want to borrow effects from one image, and apply
    to another... OK

    But frankly, as soon as I read your question, I was wondering - why not
    produce
    new bubbles yourself, which could be any way you liked, rather than
    trying to
    copy from a more limited set in another picture ?
    Im quite certain Ive seen tutorials which specifically produce
    [bubbles]... maybe
    even in Gimp !

    > Unfortunately <snips interesting discussion of poster's proposed solution>
    > Hope someone can help, thankyou.


    The most help I can be is to suggest you post one of your bubbles
    pictures...
    and, if possible, try to show how you'd want to use these bubbles in
    the new
    picture... from which, Id say many more people would understand how to
    help in Gimp or otherwise.


  4. Default Re: Transform a circle to a square?


    <haverber@visi.com> wrote in message
    news:1161361396.649668.281880@e3g2000cwe.googlegroups.com...
    > Quick non-GIMP background:
    >
    > I'm trying to create realistic bubbles in second life, and in doing so
    > I wish to map a transparency mask created from an actual bubble image
    > to a second life sphere object. Unfortunately the mask is circular,
    > while the second life texture mapping logic requires a rectangular map
    > or else there'd be a gap when the sphere object is actually rendered in
    > second life - it comes out looking like a round christmas bell instead
    > of a smooth sphere.


    Well I'm pretty much a Gimp wanabee but I've been making textures for the
    unreal engine with Gimp with good success. I'm still not clear on your
    question, do you want to generate true 3d spheres, an image that looks like
    a bubble or are you having trouble mapping a texture on a 3d sperical mesh?

    Often an emitter with a nice alpha mapped image of a bubble can make a
    random cascade of bubble like objects that can pop or fade in and out and
    fall towards the ground or waft away at random. Another trick to making an
    omnidirectional image would be to try to use a projector or a environmental
    map cube, such as is done for lighting effects with dynamic lighting. I
    would try these rather than trying to make a smooth looking spherical
    skeletal mesh because you risk high polygon counts to make it look nice.
    However, if that's what you want to do may I suggest that you let the game
    engine do the bubble effects! Just make it using a semi transparent texture
    and turn it into a material with high specularity (reflectance). If done
    right these little spheres are very convincing.

    I hope this helps
    Lyle



  5. Default Re: Transform a circle to a square?

    I guess I should have made this a simple question and not included the
    fooforall background to this.

    How do I transform a circle to a square?

    Thanks.


  6. Default Re: Transform a circle to a square?


    <haverber@visi.com> wrote in message
    news:1161436996.615410.322320@b28g2000cwb.googlegroups.com...
    >I guess I should have made this a simple question and not included the
    > fooforall background to this.
    >
    > How do I transform a circle to a square?
    >
    > Thanks.
    >

    Good question and one that mathematicians and topographers have never been
    able to answer very well! Think of all the different maps you've seen of
    the earth- they all are very distorted. This is why it is better to use a
    uniform texture for the sphere and have the game engine render the shading
    and reflectance part.

    Are you trying to map a square texture onto a sphere made by the game? The
    game actually makes it as a polyhedron so the application of the texture
    depends on how the polyhedron is made. How many faces does it have? How
    many sides do you see in top view looking down and how many sides from side
    view in the game editor? The game engine doesn't use the entire texture
    for the sphere. Instead it takes a triangular chunk and then takes another
    triagular chunk starting at the end of the first triangle. How big a chunk
    it takes and how it aligns the vertices varies with which face of the
    polygon you are texturing. Also your scale is important - can the texture
    go all the way around? If not it is repeated end on end and edge on edge.
    So what really happens is that little or big triangles are taken out of the
    texture when the triangle face points up and out of the top of the texture
    when the triangle face points down. The rest of the texture is never used!
    So first try an experiment - make several textures for an 8 ball from pool.
    Fiddle around with where you put the white circle with the '8' in it on the
    otherwise black texture. now apply them to your sphere and fiddle with
    scale and offset settings to see if you can align just those 2 spots! Its
    tough, I've done it. There are a lot of ways to skin this particular cat,
    experiment and let us know what you learn.
    Lyle



  7. Default Re: Transform a circle to a square?

    I'm starting to feel like a pinata here...lets not complicate things,
    OK, please?

    Look, the texture mapping for second life maps a square to a sphere, so
    the texture I need to apply has to be a square. I've already
    experimented six ways from Sunday to determine that, making my own
    little coordinate grid texture with circles, squares, and angles to
    help me determine how the texture gets mapped. For reference, by the
    way, its the Havoc 1 engine, and no, I don't have ANY access to its
    internals beyond the limited access Second Life has scripted for it. I
    CANNOT do ANYTHING detailed with the game or physics engine. I just
    have a simple question about how to do something in GIMP. Let's keep
    focused, please?

    Please, forget the game engine, please, forget triangles, vertices,
    rendering, and making yet more textures. I'm happy with the textures I
    have. I don't want to make anymore. This is a GIMP newsgroup, and I
    have one simple question related to GIMP:

    How do I transform a circle to a square using a Windows XP install of
    GIMP, or other free/cheap windows software?

    Thankyou.


  8. Default Re: Transform a circle to a square?

    haverber@visi.com wrote:
    > I'm starting to feel like a pinata here...lets not complicate things,
    > OK, please?


    OK - try this link
    http://www.pinatas.com/

    just kidding :-)

    lessee... you want to transform a circle into a square... well... this
    is
    something Ive seen done, but not in Gimp... not even with the stretch
    tool -
    but, how about if you just cut a square shape out of your circle ?
    Would
    that work ? Gimp definitely can cut square shapes out of circular ones
    -
    if only most of the circle would do, try that maybe.


  9. Default Re: Transform a circle to a square?

    > lessee... you want to transform a circle into a square... well... this
    > is
    > something Ive seen done, but not in Gimp... not even with the stretch
    > tool -
    > but, how about if you just cut a square shape out of your circle ?
    > Would
    > that work ? Gimp definitely can cut square shapes out of circular ones
    > -
    > if only most of the circle would do, try that maybe.


    Where have you seen this done before? I would be very interested to
    know.

    As for cutting a square out, no - that wouldn't work. A lot of the
    detail for a bubble is at the edges where there is a lot of
    reflection/refraction/whathave you and this would be lost.

    It would be really great if there were a filter that took shape "A" and
    shape "B", and then transferred/stretched/squashed pixels to fit that
    transformation. I think that would be idea for me, as a windows plugin.


  10. Default Re: Transform a circle to a square?

    haverber@visi.com wrote:
    > Quick non-GIMP background:
    >
    > I'm trying to create realistic bubbles in second life, and in doing so
    > I wish to map a transparency mask created from an actual bubble image


    > Hope someone can help, thankyou.
    >


    Is this something similar to what you want?

    http://www.worth1000.com/cache/conte...play=photoshop


+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Circle - Square Collision Detection
    By Application Development in forum Java-Games
    Replies: 8
    Last Post: 10-28-2007, 05:57 PM
  2. How to add a circle in a square and have it'snap' to the boundaries?
    By Application Development in forum Adobe Photoshop
    Replies: 14
    Last Post: 09-04-2007, 05:21 AM
  3. transform an image: invert in a circle
    By Application Development in forum Graphics
    Replies: 9
    Last Post: 03-21-2007, 04:04 AM
  4. square texture on circle (using gluDisk)
    By Application Development in forum Graphics
    Replies: 1
    Last Post: 07-03-2006, 03:50 PM
  5. Multiplot- point data filled square/circle
    By Application Development in forum Graphics
    Replies: 2
    Last Post: 11-21-2005, 04:58 AM