fix: Vertical flip
Fix the difference in (0,0) assumption of jpg and computer graphics.
This commit is contained in:
parent
4cf9851fbc
commit
08c5c9e8da
2 changed files with 7 additions and 5 deletions
4
main.cpp
4
main.cpp
|
@ -87,7 +87,9 @@ int main(int argc, char * argv[])
|
|||
|
||||
// Compute viewing ray
|
||||
Ray ray;
|
||||
viewing_ray(camera,i,j,width,height,ray);
|
||||
/* NOTE I flipped the vertical axis of the pixels, because in computer graphics we assume the bottom left pixel
|
||||
* is (0,0), while traditional jpg assumes (0,0) to be the upper left pixel. */
|
||||
viewing_ray(camera,height - i,j,width,height,ray);
|
||||
|
||||
// Find first visible object hit by ray and its surface normal n
|
||||
double t;
|
||||
|
|
Reference in a new issue