You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Book 2 chapter 4 section 2 concludes by passing a shared ptr of the newly created checker_texture class into to the make_shared function (Listing 25).
auto checker = make_shared<checker_texture>(0.32, color(.2, .3, .1), color(.9, .9, .9));
world.add(make_shared<sphere>(point3(0,-1000,0), 1000, make_shared<lambertian>(checker)));
// make_shared<lambertian>(checker) // lambertian has no constructor for shared_ptr<texture> by 4.2
An image is then shown, implying the code should be runnable. However, by this point, lambertian has no constructor that takes a shared_ptr. That constructor is introduced later in chapter 4, section 4 (Listing 30).
lambertian(shared_ptr<texture> a) : albedo(a) {}
It may be useful to introduce the constructor changes to the children of the material class before Listing 25, as walking through this awesome tutorial, I ended up having trouble here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Book 2 chapter 4 section 2 concludes by passing a shared ptr of the newly created checker_texture class into to the make_shared function (Listing 25).
An image is then shown, implying the code should be runnable. However, by this point, lambertian has no constructor that takes a shared_ptr. That constructor is introduced later in chapter 4, section 4 (Listing 30).
It may be useful to introduce the constructor changes to the children of the material class before Listing 25, as walking through this awesome tutorial, I ended up having trouble here.
Beta Was this translation helpful? Give feedback.
All reactions