currently I am working on Rotation of Android ImageView and my goal is to be able to, beside setting the angle of rotation, set the perspective after transformation is set.
-First, thing that I've tried was overriding SetCameraDistance() method, but even if method is called as it should, no metter which value I use for distance no change happens after rendering (?)
-Second, I tried to use Android's Graphics.Camera object and it's SetLocation() method, but I am not sure how this works since values that this method receives are not pixels but some other values that I do not understand. The only thing is that default Z value is -8 (?) and if I set it to be under -3, Image is not render at all. I found something on StackOverflow stackoverflow.com/questions/27704670/android-view-3d-rotate-transformation-on-big-resolution-screens but still I was not able to set perspective properly.
On iOS everything seems more obvious since perspective thing is related with m34 value in Transformation Matrix of component:
var transform = CoreAnimation.CATransform3D.Identity; transform.m34 = new nfloat(-1f) / (new nfloat(_component.Perspective) * scaleFactor); transform = transform.Rotate(new nfloat(_component.Rotation.RotationX * Math.PI / 180f), 1, 0, 0); // X axis transform = transform.Rotate(new nfloat(_component.Rotation.RotationY * Math.PI / 180f), 0, 1, 0); // Y axis transform = transform.Rotate(new nfloat(_component.Rotation.RotationZ * Math.PI / 180f), 0, 0, 1); // Z axis
Suppose that there must be something similar for Android Platform.
I would really appreciate some help.
Thanks in advance