Default to applying depth test for non-fixed objects added to a 3d scene

This commit is contained in:
Grant Sanderson 2023-01-28 15:02:00 -08:00
parent 368f48f8dd
commit c08e111911

View file

@ -983,3 +983,9 @@ class EndScene(Exception):
class ThreeDScene(Scene): class ThreeDScene(Scene):
samples = 4 samples = 4
default_frame_orientation = (-30, 70) default_frame_orientation = (-30, 70)
def add(self, *mobjects, set_depth_test: bool = True):
for mob in mobjects:
if set_depth_test and not mob.is_fixed_in_frame():
mob.apply_depth_test()
super().add(*mobjects)