3

我正在创建一个 CC3PlaneNode (cocos3d),其代码如下所示:

CC3PlaneNode *bnode = [CC3PlaneNode nodeWithName: name];
CC3Texture *texture = [CC3Texture textureFromFile: texName];
[bnode populateAsCenteredRectangleWithSize: sz
                           andTessellation: ccg(1, 1)
                               withTexture: texture
                             invertTexture: YES];
bnode.material.specularColor = kCCC4FLightGray;
bnode.material.emissionColor = kCCC4FWhite;
bnode.material.isOpaque = NO;
bnode.shouldCullBackFaces = NO;
bnode.isTouchEnabled = YES;
bnode.location = loc;
[bnode retainVertexLocations];

在某些情况下,我希望飞机显示其纹理的镜像(许多图像程序上水平翻转功能。)我不只是想翻转飞机本身,因为那会抛出 - of-position 所有它的子节点,这是不受欢迎的行为。

也就是说,如果 X 和 Y 是我的纹理的一部分,并且“c”和“c'”是该图中的子节点:

+--------+
|        |
|  x   y |
|        |
+--------+
 c      c'

翻转后,我希望事情看起来像这样:

+--------+
|        |
|  y   x |
|        |
+--------+
 c      c'

除了不想旋转/旋转/翻转飞机本身之外,我在解决方案上非常灵活。

有什么提示吗?

谢谢!

4

0 回答 0