Closed ddxtanx closed 5 years ago
There's an old_projects/three_dimensions.py file with a class Sphere and a function generate_points, could this be what you're looking for?
class Sphere(Mobject2D):
def generate_points(self):
self.add_points([
(
np.sin(phi) * np.cos(theta),
np.sin(phi) * np.sin(theta),
np.cos(phi)
)
for phi in np.arange(self.epsilon, np.pi, self.epsilon)
for theta in np.arange(0, 2 * np.pi, 2 * self.epsilon / np.sin(phi))
])
self.set_color(BLUE)
def unit_normal(self, coords):
return np.array(coords) / np.linalg.norm(coords)
At the moment, there is not. I have been using Grapher to generate most curved 3d visuals. Pull requests accepted though :)
Closing, as this was addressed in #145.
I've tried to use the Sphere() class in topics/three_dimensions.py but, by default, it is very 'point'-y and not shaded. How could I generate something similar to the spheres and curved 3D objects in 3B1B videos?