3b1b / 3b1b/manim

Getting 3D grid and Rendering circle on the surface of a sphere

オープン
#615 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
93.9k
フォーク
7.7k
平均マージ
2日 13時間
マージ済み PR(30日)
4

説明

I am trying to do some stuff with Differential Geometry / Manifolds.

I know how to transform a 2D plane to 3D
```
def construct(self):
grid = NumberPlane()
sphere = Sphere()
self.add(grid)
self.add_axes()
self.play(FadeIn(sphere))
grid.prepare_for_nonlinear_transform()
SomeRandomTransform = lambda p: p + np.array([p[0]**2, p[1]+p[0] ,p[0]*p[1]])
self.play(grid.apply_function, SomeRandomTransform,
sphere.apply_function, SomeRandomTransform)
self.begin_ambient_camera_rotation(rate=0.1)
self.wait(5)

def add_axes(self):
axes = self.axes = self.get_axes()
axes.set_stroke(width=0.5)
self.add(axes)

# Orient
self.set_camera_orientation(
phi=70 * DEGREES,
theta=-110 * DEGREES,
)
self.begin_ambient_camera_rotation()

```

What I am trying to, or rather want to, do is to convert the grid to a parametric surface, and then draw over that parametric surface. (basically the same thing as above, but instead of `SomeRandomTransform` I want to use a specific parametric surface, like torous or sphere).
```
trr = lambda u, v : np.array([
(c + a * np.cos(TAU * v)) * np.cos(TAU*u),
(c + a * np.cos(TAU * v)) * np.sin(TAU * u),
a * np.sin(TAU * v)
])
```

As per my understanding, for that, I (should) need a 3D grid, but I can't find a function for creating it. Can you please let me know which function to use for generating 3D grid?

Also, If I have a sphere object, how would I go about rendering a circle on the *surface* of the sphere object?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。