summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-22 19:31:49 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-22 19:31:49 +0000
commitcefaf08c831bb1acdda55b7d38192fac3ead6d59 (patch)
tree5b84f38d49191bd63d7072e48f803fd5e30df8e2 /libass/ass_render.c
parent05ecf2c10f6acd6c893b4eb54651d15155ae0361 (diff)
downloadlibass-cefaf08c831bb1acdda55b7d38192fac3ead6d59.tar.bz2
libass-cefaf08c831bb1acdda55b7d38192fac3ead6d59.tar.xz
Better handling of behind-the-camera objects.
Every point that is behind the camera is moved to the clipping plane by orthographic projection. It is obviously incorrect, but this is a very rare case, and proper clipping of Bezier curves is not that easy. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26065 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 6b345a7..0565729 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1623,6 +1623,7 @@ static inline void transform_point_3d(double *a, double *m, double *b)
*/
static inline void transform_vector_3d(FT_Vector* v, double *m) {
const double camera = 2500 * frame_context.border_scale; // camera distance
+ const double cutoff_z = 10.;
double a[4], b[4];
a[0] = d6_to_double(v->x);
a[1] = d6_to_double(v->y);
@@ -1641,8 +1642,8 @@ static inline void transform_vector_3d(FT_Vector* v, double *m) {
b[0] *= camera;
b[1] *= camera;
b[3] = 8 * b[2] + camera;
- if (b[3] < 0.001 && b[3] > -0.001)
- b[3] = b[3] < 0. ? -0.001 : 0.001;
+ if (b[3] < cutoff_z)
+ b[3] = cutoff_z;
v->x = double_to_d6(b[0] / b[3]);
v->y = double_to_d6(b[1] / b[3]);
}