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];

特定の状況下では、平面にそのテクスチャの鏡像を表示させたいと思います (多くの画像プログラムの Flip Horizo​​ntal 機能のようなものです) これは望ましくない動作です。

つまり、X と Y がテクスチャの一部であり、"c" と "c'" がこの図の子ノードである場合:

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

反転後、次のようにしたいと思います。

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

平面自体を回転/スピン/反転させたくないことを除けば、それ以外の場合、私はソリューションに対してかなり柔軟です。

ヒントはありますか?

ありがとう!

4

0 に答える 0