mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Fixed projection
This commit is contained in:
parent
568d02602c
commit
daffec0034
1 changed files with 3 additions and 3 deletions
|
@ -156,8 +156,8 @@ class ThreeDCamera(Camera):
|
||||||
points -= fc
|
points -= fc
|
||||||
rot_matrix = self.get_rotation_matrix()
|
rot_matrix = self.get_rotation_matrix()
|
||||||
points = np.dot(points, rot_matrix.T)
|
points = np.dot(points, rot_matrix.T)
|
||||||
zs = points[:, 2]
|
zs = np.clip(points[:, 2], -np.inf, distance - 0.001)
|
||||||
points[:, 0] *= (distance + zs) / distance
|
for i in 0, 1:
|
||||||
points[:, 1] *= (distance + zs) / distance
|
points[:, i] *= distance / (distance - zs)
|
||||||
points += fc
|
points += fc
|
||||||
return points
|
return points
|
||||||
|
|
Loading…
Add table
Reference in a new issue