mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 22:13:30 +08:00
apply_matrix for Mobject
This commit is contained in:
@ -162,6 +162,12 @@ class Mobject(object):
|
||||
mob.points = np.apply_along_axis(function, 1, mob.points)
|
||||
return self
|
||||
|
||||
def apply_matrix(self, matrix):
|
||||
matrix = np.array(matrix)
|
||||
for mob in self.family_members_with_points():
|
||||
mob.points = np.dot(mob.points, matrix.T)
|
||||
return self
|
||||
|
||||
def wag(self, direction = RIGHT, axis = DOWN, wag_factor = 1.0):
|
||||
for mob in self.family_members_with_points():
|
||||
alphas = np.dot(mob.points, np.transpose(axis))
|
||||
@ -706,8 +712,6 @@ class Mobject(object):
|
||||
def pointwise_become_partial(self, mobject, a, b):
|
||||
pass #To implement in subclass
|
||||
|
||||
|
||||
|
||||
class Group(Mobject):
|
||||
#Alternate name to improve readibility in cases where
|
||||
#the mobject is used primarily for its submobject housing
|
||||
|
Reference in New Issue
Block a user