mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
proper transformations
This commit is contained in:
parent
f0bf3f5833
commit
3ca0c6ac61
1 changed files with 2 additions and 12 deletions
|
|
@ -4,15 +4,6 @@
|
|||
#include "./camera_uniform_declarations.glsl"
|
||||
#include "./mobject_uniform_declarations.glsl"
|
||||
|
||||
vec3 rotate_point_into_frame(vec3 point)
|
||||
{
|
||||
if (bool(is_fixed_in_frame))
|
||||
{
|
||||
return point;
|
||||
}
|
||||
return camera_rotation * point;
|
||||
}
|
||||
|
||||
vec3 position_point_into_frame(vec3 point)
|
||||
{
|
||||
if (bool(is_fixed_in_frame))
|
||||
|
|
@ -21,9 +12,8 @@ vec3 position_point_into_frame(vec3 point)
|
|||
}
|
||||
if (bool(is_fixed_orientation))
|
||||
{
|
||||
vec3 new_center = rotate_point_into_frame(fixed_orientation_center);
|
||||
return point + (new_center - fixed_orientation_center);
|
||||
return point - camera_rotation * camera_center + camera_rotation * fixed_orientation_center - fixed_orientation_center;
|
||||
}
|
||||
return rotate_point_into_frame(point - camera_center);
|
||||
return camera_rotation*(point - camera_center);
|
||||
}
|
||||
#endif // POSITION_POINT_INTO_FRAME_GLSL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue