raytracing.github.io
raytracing.github.io copied to clipboard
Improve `camera.h` naming, commentary
The camera class is moderately complex, with lots of member and intermediate variables. Member variables u, v, w could use a comment indicating what they are and that they're unit length, and some of the intermediate expressions like lower_left_corner + s*horizontal + t*vertical - origin - offset could be either broken into named descriptive components or at least given a descriptive name.
In addition to this general pass, it may be appropriate to split this into one specific to book1, and duplicates specific to books 2 & 3.
The camera class has member variables s/t
the main loop has camera coordinates u/v
From what I can remember in other literature, s/t are typically used for pixel coordinates and u/v are used for texture coordinates.
We use u/vfor the member variables of textures in book 2.
Maybe we should consider renaming the main loop variables to s/t?
Can I get an update on this?
I'll move to s/t where possible and unique.
Fixed in code in PR #1154 (text updates pending).