3b1b-manim/manimlib/shaders/position_point_into_frame.glsl

10 lines
311 B
Text
Raw Normal View History

2020-06-01 16:21:18 -07:00
// Must be used in an environment with the following uniforms:
// uniform mat4 to_screen_space;
// uniform float focal_distance;
vec3 position_point_into_frame(vec3 point){
2020-06-02 16:18:44 -07:00
// Apply the pre-computed to_screen_space matrix.
2020-06-01 16:21:18 -07:00
vec4 new_point = to_screen_space * vec4(point, 1);
return new_point.xyz;
}