It now returns the correct values for both orthographic and perspective
projections and takes into account the aspect ratio of the video, handles
the Y-flipping in GL and by us and uses some more helpers from graphene.
We can avoid a render pass if downstream supports the affine transformation meta
and increase the performance of some pipelines involving gltransformation.
Implemented by checking for the affine transformation in the allocation query
from downstream and combining our matrix with that of upstream's (or creating
our own).
Reverses the transformation applied through the properties and forwards the
event.
The process for finding the coordinates on the video are as follows:
1. Convert the given pointer_x and pointer_y to model space at the near and far planes
2. Get the equation of the video plane
3. Find where the ray in 1 intersects the plane
4. Profit!
https://bugzilla.gnome.org/show_bug.cgi?id=744763
Add a pivot vector for setting the origin of rotations and scales.
With the pivot point the rotation and scale operations can have
different origins. This adds the ability to rotate around different points.
Currently the default (0, 0) pivot point is possible,
a rotation around the center, and zooming into and out of the center.
With an pivot point this is optional.
I defined the following image coordinates for the pivot point:
(-1,1) ------------------------- (1,1)
| |
| |
| |
| (0,0) |
| |
| |
| |
(-1,-1) ------------------------- (1,-1)
Example:
Rotate the video at the bottom left corner
gst-launch-1.0 videotestsrc \
! gltransformation \
scale-x=0.5 \
scale-y=0.5 \
rotation-z=25.0 \
pivot-x=-1.0 \
pivot-y=-1.0 \
! glimagesink
The pivot-z option defines the pivot point in 3D space.
This only affects rotation, since we have no Z data to scale.
With this option a video can be rotated around a point in 3D space.
Example:
Rotate around point behind the video:
gst-launch-1.0 videotestsrc \
! gltransformation \
rotation-x=10.0 \
pivot-z=-4.0 \
! glimagesink
The graphene-1.0 part should not be in the source code. This directory
is part of the cflags include. This is similar to gstreamer-1.0/
directory. This break compilation if the include directory where
graphene is installed is not in your include path.
* aspect should not be 0 on init
* rename fovy to fov
* add mvp to properties as boxed graphene type
* fix transformation order. scale first
* clear color with 1.0 alpha
https://bugzilla.gnome.org/show_bug.cgi?id=734223