mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Orient Camera.get_pixel_array correctly
This commit is contained in:
parent
632819dd6d
commit
8e3378f798
1 changed files with 2 additions and 1 deletions
|
@ -305,7 +305,8 @@ class Camera(object):
|
|||
def get_pixel_array(self) -> np.ndarray:
|
||||
raw = self.get_raw_fbo_data(dtype='f4')
|
||||
flat_arr = np.frombuffer(raw, dtype='f4')
|
||||
arr = flat_arr.reshape([*self.fbo.size, self.n_channels])
|
||||
arr = flat_arr.reshape([*reversed(self.fbo.size), self.n_channels])
|
||||
arr = arr[::-1]
|
||||
# Convert from float
|
||||
return (self.rgb_max_val * arr).astype(self.pixel_array_dtype)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue