mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 13:07:44 +00:00
Add stand in for a ribboning effect
This commit is contained in:
parent
c61c18486c
commit
f363eaa2fd
1 changed files with 10 additions and 0 deletions
|
|
@ -147,6 +147,16 @@ void emit_point_with_width(
|
||||||
// triangle strip around the polyline
|
// triangle strip around the polyline
|
||||||
vec3 step = step_to_corner(point, unit_tan, unit_normal, unit_jp, inner_joint);
|
vec3 step = step_to_corner(point, unit_tan, unit_normal, unit_jp, inner_joint);
|
||||||
|
|
||||||
|
// TODO, this gives a somewhat nice effect that's like a ribbon mostly with its
|
||||||
|
// broad side to the camera. Currently unused by VMobject
|
||||||
|
if(flat_stroke == 2.0){
|
||||||
|
// Rotate the step towards the unit normal by an amount depending
|
||||||
|
// on the camera position
|
||||||
|
float cos_angle = dot(unit_normal, normalize(camera_position));
|
||||||
|
float sin_angle = sqrt(max(1 - cos_angle * cos_angle, 0));
|
||||||
|
step = cos_angle * step + sin_angle * unit_normal;
|
||||||
|
}
|
||||||
|
|
||||||
// Set styling
|
// Set styling
|
||||||
color = finalize_color(joint_color, point, unit_normal);
|
color = finalize_color(joint_color, point, unit_normal);
|
||||||
if (width == 0) scaled_anti_alias_width = -1.0; // Signal to discard in frag
|
if (width == 0) scaled_anti_alias_width = -1.0; // Signal to discard in frag
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue