Unity - seeking reflection vector (2d)

Seeking reflection vector

https://www.cnblogs.com/graphics/archive/2013/02/21/2920627.html
above is the big brother of the formula can take a look

Gangster borrowed map

1, the IO request is incident vector of the vectors


Ball incident vector is vector position to the current position of the four pillars of
the code:

private Vector3 CurrentPos;//  记录当前坐标
void Start()
{
    CurrentPos = transform.position //记住最开始坐标
}
//碰撞的时候   CurrentPos ->  自身  的向量就是入射向量
Vector3 IncidenceNm = (transform.position - CurrentPos).normalized;

2, ON Seeking vector of the vectors

//2d的法向量  ,由于空间内有无数个垂直于已知平面   因此一个平面有无数个法向量  
//所以 我用的是这两个代表横向和竖向 new Vector3(1, 0, 0)  new Vector3(0, 1, 0)

3, seeking reflection vector vector OR

//因为Unity中自带的有API  //Vector3.Reflec(入射向量,法向量) 
//所以求反射向量的时候把上面的两个向量传入进来就可以求出反射向量了

4, to the following figure

Guess you like

Origin www.cnblogs.com/Aaron-Han/p/12120246.html