mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 07:07:46 +00:00
Incorporate frame_center in translation to gl_Position
This commit is contained in:
parent
052aa8afe2
commit
15e3178721
2 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ layout (triangle_strip, max_vertices = 5) out;
|
|||
uniform float scale;
|
||||
uniform float aspect_ratio;
|
||||
uniform float anti_alias_width;
|
||||
uniform vec3 frame_center;
|
||||
|
||||
in vec2 bp[3];
|
||||
in vec4 v_color[3];
|
||||
|
|
@ -62,6 +63,7 @@ mat3 get_xy_to_wz(vec2 b0, vec2 b1, vec2 b2){
|
|||
void set_gl_Position(vec2 p){
|
||||
vec2 result = p / scale;
|
||||
result.x /= aspect_ratio;
|
||||
result -= frame_center.xy;
|
||||
gl_Position = vec4(result, 0.0, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ layout (triangle_strip, max_vertices = 5) out;
|
|||
uniform float scale;
|
||||
uniform float aspect_ratio;
|
||||
uniform float anti_alias_width;
|
||||
uniform vec3 frame_center;
|
||||
|
||||
in vec2 bp[3];
|
||||
in vec2 prev_bp[3];
|
||||
|
|
@ -266,6 +267,7 @@ void set_previous_and_next(vec2 controls[3], int degree){
|
|||
void set_gl_Position(vec2 p){
|
||||
vec2 result = p / scale;
|
||||
result.x /= aspect_ratio;
|
||||
result -= frame_center.xy;
|
||||
gl_Position = vec4(result, 0.0, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue