main
This commit is contained in:
parent
ec63b97756
commit
04e070ccbb
39
kglobe.py
39
kglobe.py
@ -6,21 +6,28 @@ from PIL import Image
|
|||||||
|
|
||||||
import pyvista as pv
|
import pyvista as pv
|
||||||
|
|
||||||
sphere = pv.Tetrahedron()# Sphere()
|
def main():
|
||||||
pl=pv.Plotter(off_screen=True)
|
sphere = pv.Tetrahedron()# Sphere()
|
||||||
pl.add_mesh(sphere, color='tan', show_edges=False)
|
|
||||||
|
|
||||||
hide_cursor()
|
globe = pv.examples.load_globe()
|
||||||
y, x = get_position()
|
tex = pv.examples.load_globe_texture()
|
||||||
print('\n' * 25, end='')
|
pl=pv.Plotter(off_screen=True)
|
||||||
|
pl.add_mesh(globe, color='tan', smooth_shading=True, texture=tex, show_edges=False)
|
||||||
|
|
||||||
frames = []
|
hide_cursor()
|
||||||
try:
|
y, x = get_position()
|
||||||
while True:
|
print('\n' * 25, end='')
|
||||||
pl.camera.Azimuth(1)
|
|
||||||
image = pl.screenshot(transparent_background=True, window_size=(512, 512))
|
frames = []
|
||||||
frames.append(Image.fromarray(image))
|
try:
|
||||||
set_position(y-25, x)
|
while True:
|
||||||
draw_to_terminal(Image.fromarray(image))
|
pl.camera.Azimuth(1)
|
||||||
finally:
|
image = pl.screenshot(transparent_background=True, window_size=(512, 512))
|
||||||
show_cursor()
|
frames.append(Image.fromarray(image))
|
||||||
|
set_position(y-25, x)
|
||||||
|
draw_to_terminal(Image.fromarray(image))
|
||||||
|
finally:
|
||||||
|
show_cursor()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user