0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

3Dプレイヤーの回転をなめらかにする方法

Posted at

➀リアルタイムのプレイヤーの角度情報、向けたい角度(goalRot)を指定。
➁目的のキーを押したときにgoalRotを代入(例:右だと90度)
➂goalRot以下だとspeedRotずつ回転

しかしこのやり方だと、speedRot=8の時など、割り切れないときに、90度以上(96度)になった時に8度だけ引き戻そうとして88度になって、90度以下になるからまた8度回転して96度になって…という繰り返しになり、プレイヤーがぶるぶるする。(ちなみにspeedRot=8でないといけないという条件付きなのでspeedを変えるということはできない)

なのでしきい値を使って、90+しきい値、90-しきい値は90度ということにするという処理が必要みたいだが、そこはまだわかってない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?