mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
Using Camera class instead of displayer module
This commit is contained in:
@ -7,7 +7,6 @@ from random import random
|
||||
from copy import deepcopy
|
||||
from colour import Color
|
||||
|
||||
import displayer as disp
|
||||
from helpers import *
|
||||
|
||||
|
||||
@ -20,6 +19,7 @@ class Mobject(object):
|
||||
"color" : WHITE,
|
||||
"point_thickness" : DEFAULT_POINT_THICKNESS,
|
||||
"name" : None,
|
||||
"display_mode" : "points"
|
||||
}
|
||||
DIM = 3
|
||||
def __init__(self, *sub_mobjects, **kwargs):
|
||||
@ -100,7 +100,10 @@ class Mobject(object):
|
||||
return self
|
||||
|
||||
def show(self):
|
||||
Image.fromarray(disp.paint_mobject(self)).show()
|
||||
from camera import Camera
|
||||
camera = Camera()
|
||||
camera.capture_mobject(self)
|
||||
Image.fromarray(camera.get_image()).show()
|
||||
|
||||
def save_image(self, name = None):
|
||||
Image.fromarray(disp.paint_mobject(self)).save(
|
||||
|
Reference in New Issue
Block a user