3D旋转X轴有问题 [英] Rotate 3D got issue in X axis
问题描述
我有ROTATE3D一个图像。这里是我的code ..
I have rotate3d one image.. Here is my code..
CALayer *layer = backImageView.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -300;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, 15.0f * M_PI / 180.0f, 1.0f, 0.0f, 0.0f);
layer.transform = rotationAndPerspectiveTransform;
像以前一样把背景图片看起来像
As before putting background image looks like
在
但是当我把一个更多的图像作为背景,它看起来像这样..
But when i put one more image as a background it looks like this..
X(-ve) - 轴不显示。
X(-ve) - axis should not be displayed..
有什么事错在code或需要添加额外的逻辑或code?
Is there any thing wrong in code or need to add extra logic or code ?
谢谢..
推荐答案
我有同样的问题。其发生becouse旋转前两个图像中的同一平面内放置,但后的图像的转动部分显示平面的后面,并通过另一个覆盖。我的解决办法是拖上另一架飞机的形象之一,所以他们不重叠。
I had the same problem. Its happens becouse before rotation both images lay in the same plane, but after rotation part of the image appears behind the plane and covered by another. My solution was to drag one of the images on another plane, so they do not overlap.
grayImage.layer.transform=CATransform3DMakeTranslation(0, 0, -100);
在哪里grayImage你的第二个图像。
Where grayImage your second image.
这篇关于3D旋转X轴有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!