mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gltransformation: normalize translations
https://bugzilla.gnome.org/show_bug.cgi?id=744763 * Lubosz: use maxfloat for transformation range
This commit is contained in:
parent
80f97eaee7
commit
128c2a141a
1 changed files with 7 additions and 6 deletions
|
@ -167,19 +167,19 @@ gst_gl_transformation_class_init (GstGLTransformationClass * klass)
|
||||||
/* Translation */
|
/* Translation */
|
||||||
g_object_class_install_property (gobject_class, PROP_TRANSLATION_X,
|
g_object_class_install_property (gobject_class, PROP_TRANSLATION_X,
|
||||||
g_param_spec_float ("translation-x", "X Translation",
|
g_param_spec_float ("translation-x", "X Translation",
|
||||||
"Translates the video at the X-Axis.",
|
"Translates the video at the X-Axis, in universal [0-1] coordinate.",
|
||||||
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_TRANSLATION_Y,
|
g_object_class_install_property (gobject_class, PROP_TRANSLATION_Y,
|
||||||
g_param_spec_float ("translation-y", "Y Translation",
|
g_param_spec_float ("translation-y", "Y Translation",
|
||||||
"Translates the video at the Y-Axis.",
|
"Translates the video at the Y-Axis, in universal [0-1] coordinate.",
|
||||||
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_TRANSLATION_Z,
|
g_object_class_install_property (gobject_class, PROP_TRANSLATION_Z,
|
||||||
g_param_spec_float ("translation-z", "Z Translation",
|
g_param_spec_float ("translation-z", "Z Translation",
|
||||||
"Translates the video at the Z-Axis.",
|
"Translates the video at the Z-Axis, in universal [0-1] coordinate.",
|
||||||
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
-G_MAXFLOAT, G_MAXFLOAT, 0.0,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
@ -230,9 +230,10 @@ static void
|
||||||
gst_gl_transformation_build_mvp (GstGLTransformation * transformation)
|
gst_gl_transformation_build_mvp (GstGLTransformation * transformation)
|
||||||
{
|
{
|
||||||
graphene_point3d_t translation_vector =
|
graphene_point3d_t translation_vector =
|
||||||
GRAPHENE_POINT3D_INIT (transformation->xtranslation,
|
GRAPHENE_POINT3D_INIT (transformation->xtranslation * 2.0 *
|
||||||
transformation->ytranslation,
|
transformation->aspect,
|
||||||
transformation->ztranslation);
|
transformation->ytranslation * 2.0,
|
||||||
|
transformation->ztranslation * 2.0);
|
||||||
|
|
||||||
graphene_matrix_t model_matrix;
|
graphene_matrix_t model_matrix;
|
||||||
graphene_matrix_t projection_matrix;
|
graphene_matrix_t projection_matrix;
|
||||||
|
|
Loading…
Reference in a new issue