Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused line of code, "The Next Week" main.cc #317

Closed
cgyurgyik opened this issue Jan 3, 2020 · 7 comments
Closed

Unused line of code, "The Next Week" main.cc #317

cgyurgyik opened this issue Jan 3, 2020 · 7 comments

Comments

@cgyurgyik
Copy link

In the main.cc file,
You have:

camera cam(lookfrom, lookat, vec3(0,1,0), vfov, float(nx)/float(ny), aperture, dist_to_focus, 0.0, 1.0);

    for (int j = ny-1; j >= 0; j--) {
        for (int i = 0; i < nx; i++) {
            vec3 col(0, 0, 0);
            for (int s=0; s < ns; s++) {
                float u = float(i+random_double())/ float(nx);
                float v = float(j+random_double())/ float(ny);
                ray r = cam.get_ray(u, v);
                vec3 p = r.point_at_parameter(2.0);
                col += color(r, world,0);
            }
            col /= float(ns);
            col = vec3( sqrt(col[0]), sqrt(col[1]), sqrt(col[2]) );
            int ir = int(255.99*col[0]); 
            int ig = int(255.99*col[1]); 
            int ib = int(255.99*col[2]); 
            std::cout << ir << " " << ig << " " << ib << "\n";
        }
    }
}

Is vec3 p = r.point_at_parameter(2.0); necessary for anything?

@trevordblack
Copy link
Collaborator

trevordblack commented Jan 3, 2020 via email

@hollasch
Copy link
Collaborator

hollasch commented Jan 3, 2020

Ugh. Another fix that didn't make it to all locations. It's in code for TheNextWeek, and in books 1 & 2.

@trevordblack
Copy link
Collaborator

I can only find it in books/RayTracingTheRestOfYourLife.html:2142

where else did you find it?

@cgyurgyik
Copy link
Author

cgyurgyik commented Jan 14, 2020

books/InOneWeekend.html:794

@trevordblack
Copy link
Collaborator

The master branch is from the long long old way back time of September.

Check any issues against the development branch. Which is a good 200+ commits ahead of master

vec3 p = r. ...
shows up in the master branch at books/InOneWeekend.html:794 , but not in the development branch.

This still needs to be removed from books/RayTracingTheRestOfYourLife.html:2142 in the development branch.
But, I can't find it anywhere else in that branch.

Was it somewhere else in the development branch?

hollasch added a commit that referenced this issue Jan 14, 2020
@hollasch
Copy link
Collaborator

hollasch commented Jan 14, 2020

Gah! I submitted the fix in 66d3d46, but apparently didn't close this issue. Which is fine, because I'd missed the one in The Rest Of Your Life.

@hollasch
Copy link
Collaborator

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants