|
 |
I'm still working on unraveling the source code for
bool Sor::Intersect, line 239 in sor.cpp
Line 276 has the interesting expression: r0 = P[X] * D[Z] - P[Z] * D[X];
and I wasn't sure what that exactly did, especially since the comment that
precedes it is
/* Get distance of the ray from rotation axis (= y axis). */
and that didn't look like any distance formula that I've ever seen.
The minus sign certainly helped obscure its meaning and purpose.
Apparently it's a sort of 2D cross-product, or "perp-product"
https://s.goessner.net/articles/crossProductHarmful.html
Also being covered in Graphics Gems IV:
Hill, F. S., Jr., The Pleasures of `Perp Dot' Products, p. 138-148.
And since I'm speculating that there are other examples this to be found in
source, I'm documenting this fully here for future reference.
immediately following that, I have a comparison of the length of the ray
direction vector D with some variable "a", which due to poor source code
documentation, I have no idea what "a" exactly is, or why if they are equal that
r0 has to get divided by the sqrt of a.
#if ((a = Dx * D.x + D.z * D.z) > 0.0)
#local r0 = r0/sqrt(a);
#end
I also have Entry->A (through D) which I need to figure out.
- BW
Post a reply to this message
|
 |