我有4個點,其中三個點使得兩行像一個V或一個<或a>,你明白了,現在我得到了一個點在那個圓錐體中V),我可以從頂部到左下角,右下角,但不是底部pos的位置。得到兩行之間的一個點的距離
也許這會有所幫助。
而且我有代碼來解決這個問題附和:
public float GetDist(Vector3f one, Vector3f two, Vector3f three, Vector3f p){
Vector3f one_to_point = new Vector3f(0,0,0);
Vector3f.sub(p,one,one_to_point); //Storing vector A->P
Vector3f one_to_two = new Vector3f(0,0,0);
Vector3f.sub(two, one, one_to_two); //Storing vector A->B
Vector3f one_to_three = new Vector3f(0,0,0);
Vector3f.sub(three, one, one_to_three); //Storing vector A->C
float q1 = Vector3f.dot(one_to_point, one_to_two)/one_to_two.lengthSquared(); // The normalized "distance" from a to b
float q2 = Vector3f.dot(one_to_point, one_to_three)/one_to_three.lengthSquared(); // The normalized "distance" from a to c
現在我已經知道,POS向量是在錐體,還等什麼,我需要做的就是在POS如圖所示由圖像中的綠色圓圈pos?
多遠是綠色點沿行? –
它會在B和C的末尾,但它會在B到C的長度上有所不同。 – CyanPrime