how to dothis in opengl

Discussion in 'iOS Programming' started by chhoda, Jun 12, 2009.

  1. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    Hi All,

    I have read openGl a bit and have drawn a bit of rotating shapes etc..

    But I need a situation where the view is splashed with random colors and when it is touched, it is changed to something like colours moving there. Lot of apps are doing this, but I would appreciate anybody giving me a pointer. May be if it is possible using core graphics and core animation also.

    --ch
     

    Attached Files:

  2. Buschmaster macrumors 65816

    Buschmaster

    Joined:
    Feb 12, 2006
    Location:
    Minnesota
    #2
    I think what you will find is that often these things aren't just done simply.

    For example, there probably isn't a function called
    Code:
    doThatSweetSwirlyThingWithColors(GLColor color, GLAwesomeness awesomenessLevel)
    I'm trying to think of how I might accomplish this, and I'm not quite sure yet. Give me a minute.;)
     
  3. Buschmaster macrumors 65816

    Buschmaster

    Joined:
    Feb 12, 2006
    Location:
    Minnesota
    #3
    OpenGL it will be pretty tough, at least as far as I'm thinking of it. I would look into Core Animation and look into something I think is called Twirl Distortion.

    Good luck!:)
     
  4. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #4
    Yes, this looks like a bitmap effect; I can't imagine anything in OpenGL that would do this.
     
  5. chhoda thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #5
    twirl not found

    I searched some twirl, the term is not found in core animation. Is there any more appropriate name for this transformation ?

    --CH
     
  6. lazydog macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #6
    Hi,

    Looking at the image I'm not sure I know what the effect is exactly but it does look like something familiar. You can get a whole range of colour smudging effects by using a feedback loop. Say you have a rectangular region with some graphics in it. Grab it as an image and then draw it back to the same rectangular region but slightly rotated and enlarged or reduced. If you keep doing this you will get a swirly type thing. You can get some great effects if each time round the loop you seed some colour by drawing into the region. I would guess to achieve the effect in your image you would start off with a rectangle filled with orange and black. The origin for placing the rotated and scaled 'self' is offset to the bottom left. Alternatively you could use a convolution to do the same thing.

    b e n
     

Share This Page