我有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