سؤال

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