[過去ログ]
【3Dゲームエンジン】Unity質問スレッド32 (1002レス)
【3Dゲームエンジン】Unity質問スレッド32 http://mevius.5ch.net/test/read.cgi/gamedev/1509307535/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
827: 名前は開発中のものです。 [sage] 2017/12/12(火) 18:41:32.25 ID:w86KIWp6 結果です! angularVelocity = new Vector3(45, 30, 0) * Mathf.Deg2Rad を入力すると、 ?angularVelocity:Vector3(42.4, 37.4, 15.0) 1秒ピッタリで止めるには、FixedUpdate内でないとダメのようですね Invoke("Stop", 1.0f)で呼び出すと、 angularVelocity:Vector3(43.1, 38.6, 15.7)と 1フレーム分くらいの遅延が生じる模様・・・ ?AngleAxis:Vector3(42.4, 37.4, 15.0) ?Euler1:Vector3(45, 30, 0) ?Euler2:Vector3(45, 30, 0) ?Euler3:Vector3(45, 30, 0) angularVelocityをEulerでQuaternionに入れちゃうと、 角速度による回転結果のQuaternionと少し違うようです・・・ AngleAxisでQuaternionに入れる方が正しいみたいですね http://mevius.5ch.net/test/read.cgi/gamedev/1509307535/827
836: 名前は開発中のものです。 [sage] 2017/12/13(水) 00:01:44.95 ID:/jokcbje >>827 最初の回転状態が、 rotatiin =Quaternion.identityであれば、 1: rotation = Quaternion 2: rotation = rotation * Quaternion 3: rotation = Quaternion * rotation 1-3は全て同じ結果になります。 position = Vector3.zeroの場合、 1: position = Vector3 2: position = position + Vector3 1-2が同じ結果なのと一緒です。 http://mevius.5ch.net/test/read.cgi/gamedev/1509307535/836
838: 名前は開発中のものです。 [sage] 2017/12/13(水) 00:35:37.82 ID:/jokcbje >>825-827 Invokeが呼び出しの際に1フレーム遅れるとわかっているのであれば、 1フレーム前の時間で呼び出させば大丈夫ですよ。 void Start () { rb.angularVelocity = new Vector3(45, 30, 0) * Mathf.Deg2Rad; Invoke ("Stop", 1 - Time.fixedDeltaTime); ←1フレーム前に呼び出し } void Stop () { Debug.Log ("1秒後のrotation:" + rb.rotation.eulerAngles); rb.angularVelocity = Vector3.zero; } 「1秒後のrotation:Vector3(42.4, 37.4, 15.0)」が出ましたよ。 >>809の方法で求めた場合と一致する値です。 rb.angularVelocity = new Vector3(45, 30, 0) * Mathf.Deg2Rad angle = (rb.angularVelocity).magnitude * Mathf.Rad2Deg V = new Vector3(45, 30, 0) angle = V.magnitudeでも同じ結果になります。 http://mevius.5ch.net/test/read.cgi/gamedev/1509307535/838
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
1.752s*