mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
Add FRAME_SHAPE constant
This commit is contained in:
@ -6,7 +6,7 @@ import numpy as np
|
|||||||
from scipy.spatial.transform import Rotation
|
from scipy.spatial.transform import Rotation
|
||||||
|
|
||||||
from manimlib.constants import DEGREES, RADIANS
|
from manimlib.constants import DEGREES, RADIANS
|
||||||
from manimlib.constants import FRAME_HEIGHT, FRAME_WIDTH
|
from manimlib.constants import FRAME_SHAPE
|
||||||
from manimlib.constants import DOWN, LEFT, ORIGIN, OUT, RIGHT, UP
|
from manimlib.constants import DOWN, LEFT, ORIGIN, OUT, RIGHT, UP
|
||||||
from manimlib.mobject.mobject import Mobject
|
from manimlib.mobject.mobject import Mobject
|
||||||
from manimlib.utils.space_ops import normalize
|
from manimlib.utils.space_ops import normalize
|
||||||
@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|||||||
class CameraFrame(Mobject):
|
class CameraFrame(Mobject):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
frame_shape: tuple[float, float] = (FRAME_WIDTH, FRAME_HEIGHT),
|
frame_shape: tuple[float, float] = FRAME_SHAPE,
|
||||||
center_point: Vect3 = ORIGIN,
|
center_point: Vect3 = ORIGIN,
|
||||||
focal_dist_to_height: float = 2.0,
|
focal_dist_to_height: float = 2.0,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
@ -56,9 +56,8 @@ class CameraFrame(Mobject):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def to_default_state(self):
|
def to_default_state(self):
|
||||||
|
self.set_shape(*FRAME_SHAPE)
|
||||||
self.center()
|
self.center()
|
||||||
self.set_height(FRAME_HEIGHT)
|
|
||||||
self.set_width(FRAME_WIDTH)
|
|
||||||
self.set_orientation(self.default_orientation)
|
self.set_orientation(self.default_orientation)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ if TYPE_CHECKING:
|
|||||||
ASPECT_RATIO: float = 16.0 / 9.0
|
ASPECT_RATIO: float = 16.0 / 9.0
|
||||||
FRAME_HEIGHT: float = 8.0
|
FRAME_HEIGHT: float = 8.0
|
||||||
FRAME_WIDTH: float = FRAME_HEIGHT * ASPECT_RATIO
|
FRAME_WIDTH: float = FRAME_HEIGHT * ASPECT_RATIO
|
||||||
|
FRAME_SHAPE: tuple[float, float] = (FRAME_WIDTH, FRAME_HEIGHT)
|
||||||
FRAME_Y_RADIUS: float = FRAME_HEIGHT / 2
|
FRAME_Y_RADIUS: float = FRAME_HEIGHT / 2
|
||||||
FRAME_X_RADIUS: float = FRAME_WIDTH / 2
|
FRAME_X_RADIUS: float = FRAME_WIDTH / 2
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user