Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はゲームを作っていますが、カメラを2人のプレーヤーの横に置き、2人の中心点から約10メートル回転させて、2人の間の線から90度になるようにします。例は次のとおりです。
与えられた点の座標を(Ax、Ay)、(Bx、By)としましょう
ベクトル形式:
C =(B + A)/ 2 +-1/2 *垂直(BA)
BAx = Bx-Ax; BAy = By-Ay
BAPerpX = --BAy; BAPerpY = BAx
Cx = Ax / 2 + Bx / 2 +-BAPerpX / 2
Cy = Ay / 2 + By / 2 +-BAPerpY / 2
記号「+」または「-」を選択すると、点CはAB線に対して左または右になります。