开发者

How to flip the texture on a CC3PlaneNode?

I'm creating a CC3PlaneNode (cocos3d) with code that looks something like this:

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

U开发者_JAVA技巧nder certain circumstances, I'd like the plane to display the mirror image of its texture (a la the Flip Horizontal feature on many image programs.) I don't just want to flip the plane, itself, because that would throw out-of-position all of it's child-nodes, which is undesirable behaviour.

That is, if X & Y are parts of my texture, and "c" and "c'" are child-nodes in this diagram:

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

after the flip, I want things to look like this:

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

Other than not wanting to rotate/spin/flip the plane, itself, I'm otherwise pretty flexible on a solution.

Any hints?

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜