mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Use xyz-to-uv matrix for fill
This commit is contained in:
parent
9ed8dd5439
commit
5e1a02d2ce
1 changed files with 3 additions and 3 deletions
|
@ -83,13 +83,13 @@ void emit_pentagon(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute xy_to_uv matrix, and potentially re-evaluate bezier degree
|
// Compute xy_to_uv matrix, and potentially re-evaluate bezier degree
|
||||||
mat3 xy_to_uv = get_xy_to_uv(p0.xy, p1.xy, p2.xy, is_linear, is_linear);
|
mat4 xyz_to_uv = get_xyz_to_uv(p0, p1, p2, is_linear, is_linear);
|
||||||
uv_anti_alias_width = aaw * length(xy_to_uv[0].xy);
|
uv_anti_alias_width = aaw * length(xyz_to_uv[0].xyz);
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++){
|
for(int i = 0; i < 5; i++){
|
||||||
int j = int(sign(i - 1) + 1); // Maps i = [0, 1, 2, 3, 4] onto j = [0, 0, 1, 2, 2]
|
int j = int(sign(i - 1) + 1); // Maps i = [0, 1, 2, 3, 4] onto j = [0, 0, 1, 2, 2]
|
||||||
vec3 corner = corners[i];
|
vec3 corner = corners[i];
|
||||||
uv_coords = (xy_to_uv * vec3(corner.xy, 1.0)).xy;
|
uv_coords = (xyz_to_uv * vec4(corner, 1.0)).xy;
|
||||||
emit_vertex_wrapper(corner, j, unit_normal);
|
emit_vertex_wrapper(corner, j, unit_normal);
|
||||||
}
|
}
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
|
|
Loading…
Add table
Reference in a new issue