3D旋转X轴有问题 [英] Rotate 3D got issue in X axis

查看:212
本文介绍了3D旋转X轴有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆