回答編集履歴
2
式の誤りを修正
test
CHANGED
@@ -20,6 +20,6 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
- [Distance](https://docs.unity3d.com/ja/540/ScriptReference/Vector3.Distance.html)で○と★の距離を求め、仮にこれをrとする...Xは○と★を
|
23
|
+
- [Distance](https://docs.unity3d.com/ja/540/ScriptReference/Vector3.Distance.html)で○と★の距離を求め、仮にこれをrとする...Xは○と★を「一定の距離/r」の割合でブレンドした位置にある
|
24
24
|
|
25
|
-
- [LerpUnclamped(★の座標, ○の座標,
|
25
|
+
- [LerpUnclamped(★の座標, ○の座標, 一定の距離/r)](https://docs.unity3d.com/ja/540/ScriptReference/Vector3.LerpUnclamped.html)で★と○の座標を混ぜ合わせれば、Xの座標となる
|
1
別の方法を追記
test
CHANGED
@@ -9,3 +9,17 @@
|
|
9
9
|
- dに一定の距離を掛け、仮にこれをqとする...★から見た相対的なXの位置が求まる
|
10
10
|
|
11
11
|
- qに★の座標を足せば、求めたいXの座標となる
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
[追記]
|
18
|
+
|
19
|
+
こんな方法もありではないでしょうか?
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
- [Distance](https://docs.unity3d.com/ja/540/ScriptReference/Vector3.Distance.html)で○と★の距離を求め、仮にこれをrとする...Xは○と★を1/rの割合でブレンドした位置にある
|
24
|
+
|
25
|
+
- [LerpUnclamped(★の座標, ○の座標, 1/r)](https://docs.unity3d.com/ja/540/ScriptReference/Vector3.LerpUnclamped.html)で★と○の座標を混ぜ合わせれば、Xの座標となる
|