6

IOS向けの「Contrejour」ゲームはどれほど美しいのだろうか。特に私は弾力性のある「触手」が好きです。このビデオでは2分20秒で示されています: http ://www.youtube.com/watch?v = ptdTdJarWLw

どうすればそのような効果を実装できますか?

「Verletintegration」と呼ばれる技術があり、cocos2dでロープを描くための「verletrope」の実装さえあることを私は知っていますが、「触手」スプライトにそのような素晴らしい弾性効果をどのように作るのですか?

私はbox2Dの使用経験があり、この効果の物理を実装しようとするかもしれませんが、そのような弾性モーフィングでスプライトを描画する方法を見つけることができません。

誰かが私を助けたり、いくつかのヒントを与えることができますか?

テクニクスの説明でさえ、それは私を助けることができますか?

私はopenglの経験が少しあり、cocos2dの素晴らしい経験があるので、cocos2dを使用する予定です。

悪い英語でごめんなさい、私はあなたが私の問題を理解することを願っています:)

4

1 に答える 1

9

Box2Dを使用する場合は、frequencyHzおよびdampingRatioオプションをデフォルト以外の値に設定して距離ジョイントを試すことができます。おそらく、約4〜6の低周波数、および約0.5〜0.7の減衰は、開始するのに適したポイントである可能性があります。周波数は、ジョイントが1秒間に何回距離を修正しようとするかと考えることができ、ダンピングは、距離が毎回どれだけうまく修正されるかと考えることができます。ダンピングを1未満の値に設定すると、ジョイントの距離の修正が遅くなり、弾力性/ゴム状の動作が発生します。

As for rendering, you could indeed use verlet integration for this. Take the two anchor points of the distance joint as the endpoints of the 'rope', and put a handful of points (doesn't look like too many would be necessary) in between them in an evenly spaced line. Every timestep, the points in between will simply move towards the average of the two points on either side of themselves. You could make the rope look tighter or looser by adjusting how far the inbetween points move to the target position each time step.

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

于 2012-04-27T09:05:26.767 に答える