I'm looking to map an ImageView
drawing rect to a quadrilateral.
I was hoping I could do this by overriding ViewGroup.getChildStaticTransformation (View child, Transformation t)
and messing around with the Matrix
with and without a Camera
, but its not as simple as I would like.
I want be able to take a bitmap and project it onto a 3d plane / surface.
I thought I had found a nice and easy solution with Matrix.setRectToRect(...) but not quite there. As RectF
only allows the edges to be specified rather than the corners I cannot use to map to a trapezium. I would like to just be able to specify my destination shape rather than mess around with 3D animation classes or manually rotating a Camera
.
I know i need to brush up on my Linear Algebra but I'm hoping someone can give me some pointers :)
Thanks!
EDIT: looking around I see I want to use a Projective Transformation
EDIT: I'm going to test out this solution