Skip to content

Commit

Permalink
added additional example
Browse files Browse the repository at this point in the history
  • Loading branch information
u7678992 committed Oct 23, 2024
1 parent a138285 commit 8552af9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions manim/mobject/three_d/three_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,41 @@ def construct(self):
sphere3 = Sphere(center=(-1, 2, 0), radius=2, resolution=(16, 16))
sphere3.set_color(BLUE)
self.add(sphere3)
This example shows that overlapping spheres can intersect with rough transitions.
.. manim:: ExampleSphereOverlap
:save_last_frame:
class ExampleSphereOverlap(ThreeDScene):
def construct(self):
self.set_camera_orientation(phi=PI / 4, theta=PI / 4)
sphere1 = Sphere(
center=(0, 0, 0),
radius=1,
resolution=(20, 20),
u_range=[0, TAU],
v_range=[0, PI]
)
sphere1.set_color(RED)
self.add(sphere1)
sphere2 = Sphere(
center=(-0.5, -1, 0.5),
radius=1.2,
resolution=(20, 20),
u_range=[0, TAU],
v_range=[0, PI]
)
sphere2.set_color(GREEN)
self.add(sphere2)
sphere3 = Sphere(
center=(1, -1, 0),
radius=1.1,
resolution=(20, 20),
u_range=[0, TAU],
v_range=[0, PI]
)
sphere3.set_color(BLUE)
self.add(sphere3)
"""

def __init__(
Expand Down

0 comments on commit 8552af9

Please sign in to comment.