The reason why these suggestions aren't working is because:
1) Normalizing a ray does not change it's direction.
2) Scaling a ray does not change it's direction.
Thus, you haven't changed anything.
Try this: (like I said originally)
scanRays (int nHoriz, int nVert, float hFov){ float vFov; float hDegStep, vDegStep; float hDeg, vDeg; int h, v; Ray ray, vRay; hDegStep = hFov / ( nHoriz - 1 ); vFov = ( nVert / nHoriz ); vDegStep = vFov / ( nVert - 1 ); hFov *= -0.5f; vFov *= -0.5f; // scan the rays left to right; top to bottom for (v = 0; v < nVert; v++) { vDeg = vFov + v * vDegStep; // make a ray which goes right down the center vRay.vector.x = 0.0f; vRay.vector.y = 0.0f; vRay.vector.z = -1.0f; // rotate the ray up or down rotX (&vRay, vDeg); for (h = 0; h < nHoriz; h++) { // copy vRay to ray copyRay (&vRay, &ray); hDeg = hFov + h * hDegStep; // rotate the ray left or right rotY (&ray, hDeg); // do our ray firing here with 'ray' // happily, the ray is already normalized. } }}
EDIT: I am not saying this will remove your distortion, but it will definitely change things. Unlike scaling or normalizing a ray, which does NOTHING with regard to the angle between rays, this will create teh same angle between rays.
I don't know why line breaks don't show up in my code.
___________________________________
Edited by - bishop_pass on November 3, 2001 11:48:58 AM