|
Post by manxome on Nov 28, 2019 6:15:50 GMT
There is something I am missing here. The smooth Triangle has n1 = (0, 1, 0) n2 = (-1, 0, 0) n3 = (1, 0, 0) with u = 0.45, and v = 0.25, the normal should be given by normal = tri.n2 * 0.45 + tri.n3 * 0.25 + tri.n1 * (1 - 0.45 - 0.25), normal = (-1, 0, 0) * 0.45 + (1, 0, 0) * 0.25 + (0, 1, 0) * 0.3 normal = (-0.45, 0, 0) + (0.25, 0, 0) + (0, 0.3, 0) normal = (-0.2, 0.3, 0) which isnt even close to what the book has. What am I missing?
|
|
|
Post by accolon on Nov 28, 2019 20:23:38 GMT
Your calculation is based on the local_normal_at function description. The test uses normal_at which transforms the normal and is probably implemented in your Shape generalization at this point.
|
|
|
Post by manxome on Dec 1, 2019 23:30:52 GMT
Yes, that was it, thanks! Tests are passing now.
|
|