Mister Zimbu
Member
... and this math is SERIOUSLY fucking with my head. Anyone have any experience with this stuff?
The hard part isnt actually the raytracing, it's setting up the scene and transforming the coordinates to a UVN coordinate system. Here's what I have so far... just wondering some things:
1) Is the origin of the UVN coordinate system the point that the camera is looking at in the XYZ system? If so, if I apply the transformation matrices to the lookat point, I should get a {0,0,0} vector when the w coordinate divides out, right?
2) Do I apply the transformations to the camera's origin, too? It seems right, because then I can trace rays from the transformed camera to arbitrary points on the viewing plane.
If so, should I multiply the camera's origin matrix/vector thingy or just the UVN matrix (and not the perspective matrix)
3) In what order do I multiply the matrices? Is it UVN * Perspective or Perspective * UVN?
4) Double check these equations for me, to make sure I'm getting these right:
A x B = { AyBz - AzBy, AzBx - AxBz, AxBy - AyBx }
A . B = AxBx + AyBy + AzBz
That's all, thanks for any help if you were able to decipher my post.
The hard part isnt actually the raytracing, it's setting up the scene and transforming the coordinates to a UVN coordinate system. Here's what I have so far... just wondering some things:
1) Is the origin of the UVN coordinate system the point that the camera is looking at in the XYZ system? If so, if I apply the transformation matrices to the lookat point, I should get a {0,0,0} vector when the w coordinate divides out, right?
2) Do I apply the transformations to the camera's origin, too? It seems right, because then I can trace rays from the transformed camera to arbitrary points on the viewing plane.
If so, should I multiply the camera's origin matrix/vector thingy or just the UVN matrix (and not the perspective matrix)
3) In what order do I multiply the matrices? Is it UVN * Perspective or Perspective * UVN?
4) Double check these equations for me, to make sure I'm getting these right:
A x B = { AyBz - AzBy, AzBx - AxBz, AxBy - AyBx }
A . B = AxBx + AyBy + AzBz
That's all, thanks for any help if you were able to decipher my post.