Sub Page1_Click
Dim no As NativeObject = Me
'Rule: as many ":" as parameters
' Using here only one base-angle to make it usable in the original demo
no.RunMethod("rotateView::::",Array(myIV, myAngle, myAngle/2, myAngle/3))
End Sub
#if OBJC
- (void)rotateView:(UIView*)mView :(NSInteger)mAngleX :(NSInteger)mAngleY :(NSInteger)mAngleZ {
//Apply transformation to the PLANE
CATransform3D t = CATransform3DIdentity;
//Add the perspective!!!
t.m34 = 1.0/ -500; // Play with this for depth changes
t = CATransform3DRotate(t, mAngleX * M_PI / 180.0f, 1, 0, 0);
t = CATransform3DRotate(t, mAngleY * M_PI / 180.0f, 0, 1, 0);
t = CATransform3DRotate(t, mAngleZ * M_PI / 180.0f, 0, 0, 1);
mView.layer.transform = t;
}
#End If