fix normalize

This commit is contained in:
Yingjie Wang 2023-10-30 13:18:43 -04:00
parent 386db2d6b8
commit 10c03e4651

View File

@ -55,7 +55,7 @@ class Disk(Shapes):
if t < 0:
return None, None
intersection_point = ray.origin + t * ray.direction
intersection_point = intersection_point/np.linalg.norm(intersection_point)
intersection_point = self.center + self.radius * (intersection_point - self.center)/np.linalg.norm(intersection_point - self.center)
return t,intersection_point
def get_normal(self, point):
normal = (point - self.center)/self.radius