Skip to content

Commit ff438d7

Browse files
author
Rohit Malhotra
authored
Update README.md
1 parent 661c079 commit ff438d7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,45 @@ CONFIG = {
445445

446446
### 3D Graphing
447447

448+
```python
449+
from big_ol_pile_of_manim_imports import *
450+
451+
class ThreedSurface(ParametricSurface):
452+
453+
def __init__(self, **kwargs):
454+
kwargs = {
455+
"u_min": -2,
456+
"u_max": 2,
457+
"v_min": -2,
458+
"v_max": 2,
459+
"checkerboard_colors": [BLUE_D]
460+
}
461+
ParametricSurface.__init__(self, self.func, **kwargs)
462+
463+
def func(self, x, y):
464+
return np.array([x,y,x**2 - y**2])
465+
466+
def tangentX(self, x, y):
467+
return 2*x
468+
469+
class Test(ThreeDScene):
470+
471+
def construct(self):
472+
self.set_camera_orientation(0.6, -0.7853981, 86.6)
473+
474+
surface = ThreeDSurface()
475+
self.play(ShowCreation(surface))
476+
477+
d = Dot(np.array([0,0,0]), color = YELLOW)
478+
self.play(ShowCreation(d))
479+
480+
481+
self.wait()
482+
self.move_camera(0.8*np.pi/2, -0.45*np.pi)
483+
self.begin_ambient_camera_rotation()
484+
self.wait(9)
485+
```
486+
448487
**Click for results on YouTube:**
449488

450489
[![Youtube video link](https://img.youtube.com/vi/_XMEQRshlp4/0.jpg)](https://www.youtube.com/watch?v=_XMEQRshlp4)

0 commit comments

Comments
 (0)