解決済み -
正弦波の角度に従って回転するように画像をアニメーション化しようとしています - 正弦波は jQuery.path プラグインを使用して作成されます。
問題はスムーズな回転を得ることにあります。
私は現在、回転に jQuery 回転プラグインを使用していますが、現在のところ、滑らかな回転を作成していません。
JavaScript と jQueryについては、 http://hellosmithers.com/GNU/STALLMANQUEST.htmlを参照してください。
スクリプトは比較的多くコメントされています。
現在、回転は繰り返されるだけで、完了するまでに一定の時間がかかります。これは、正弦波が完了するのに時間がかかるため、すべての画面サイズでは機能しないことを意味します。
function mRot() { // image rotation - it goes from rA[0] (-8 degrees) to rA[1] (8 degrees) then swaps the values
// flip the values in rA - making the rotation oposite each iteration of this funciton
rA[1] = [rA[0], rA[0] = rA[1]][0];
$("#rmat").rotate({
duration: 1700,
angle: rA[0],
animateTo: rA[1],
callback: mRot
}); // I would like to remove this function - instead tying the rotation into the sine wave function somehow
}
正弦波は次のように作成されます。
SineWave = function() { // create the sine wave - as per https://github.com/weepy/jquery.path
this.css = function(p) {
s = Math.sin(p * 12);
x = winWidth - p * (winWidth + 250);
y = s * 40 + (winHeight - 440);
return {top: y + "px", left: x + "px"};
}
}
ありがとう