문제

I have been following this article on Frustum culling, and I need some help understanding the vector math behind it. More specifically, what are the vectors of 'up' and 'right' he talks about? What values do they hold? Sorry for the brief and unexciting question, but I am really stuck on this. Any help is appreciated! Thanks

도움이 되었습니까?

해결책

From the article:

A couple more unit vectors are required, namely the up vector and the right vector. The former is obtained by normalizing the vector (ux,uy,uz) (the components of this vector are the last parameters of the gluLookAt function); the latter is obtained with the cross product between the up vector and the d vector.

  • up is equal to (ux, uy, uz) / ||(ux, uy, uz)||, which is just a unit vector pointing the same direction as (ux, uy, uz).

    It's equal to (ux / sqrt(ux^2 + uy^2 + uz^2), uy / sqrt(ux^2 + uy^2 + uz^2), uz / sqrt(ux^2 + uy^2 + uz^2))

  • right is equal to up x d. I don't really want to expand that out.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top