Is there a way to morph / convert a circular sprite into a square programmatically?
- by John
I have a sprite which is basically just an image of a circle and some content inside.
Is there a way that I can programmatically stretch / distort it into something like:
I don't care so much about the distortion. The original circular image is 100x100px, and the modified image should also be 100x100px. So its really the content that is being distorted.
Can this be done using shaders or some other programmatic way ? The initial circular image is most likely determined at run time, which is why I need to programmatically convert the circular sprite to square.
Please do not edit the tags, as the question applies to both versions of cocos2d (iPhone & x), and the solution will most likely work in both regardless of whether one uses C or C++ since the apis are similar, and OpenGL commands work similarly.