Graphic effects like elastic tentacles in Contre Jour

I wonder how beautiful Contre jour is for iOS. I especially like the elastic "tentacles" shown in this video for 2 minutes. 20 seconds: http://www.youtube.com/watch?v=ptdTdJarWLw

How can I implement such effects?

I know that there is a technology called “top integration” and even a “verbal rope” implementation for drawing ropes in cocos2d, but how to make such nice elastic effects for the “tentacle” sprite?

I have experience using box2D, and I can try to implement physics for this effect, but I can not find a solution how to draw a sprite with such elastic morphing.

Can someone help me or give some hints?

Just an explanation of the technique that can help me?

I have some experience with opengl, a great cocos2d experience, so I plan on using cocos2d.

Sorry for the bad English, I hope you understand my problem :)

+6
source share
1 answer

If you use Box2D, you can try a remote connection with the frequencyHz and dampingRatio parameters set to values ​​other than the default values. Probably a low frequency of about 4-6, and attenuation of about 0.5-0.7 may be a good point to start. You can think about the frequency, how many times per second the joint tries to correct the distance and fade out, how well the distance is adjusted every time. Setting the damping to a value below 1 means that the joint will be slower to correct the distance and it will have elastic / rubber behavior.

As for rendering, you can use verbal integration for this. Take the two anchor points of the distant joint as the end points of the “rope” and put several points (it does not seem that too much will be necessary) between them in a uniformly spaced line. Each timeout, the points between them will simply move to the middle of two points on either side of themselves. You can make the rope harder or weaker by adjusting how the intermediate points move to the target position each time.

The final texture / sprite rendering will then take its position from the current location of the vertex points.

+9
source

Source: https://habr.com/ru/post/914029/


All Articles