问题
Question: Is it possible to flip/mirror a Three.js sprites texture?
Background: Using the current DEV branch of three.js
Findings so far: I first try'd to change it's 3d rotation without any effect. Then I inspected the sprites code and saw that the rotation is reseted in this line in Sprite.js:
this.rotation3d.set( 0, 0, this.rotation );
Changing the values there didn't had any effect. Digging deeper I ended up in the SpriteRenderer plugin where I got completely lost.
My understanding is that three.js is using shaders to render sprites and that this is a huge performance plus. So writing my own sprite implementation using simple faces feels like the wrong direction.
回答1:
Okey, this is a long shot, but try setting your sprite's scale to -1 (in the directions you want to flip it).
回答2:
the easiest way to flip a texture is actually to flip the texture image before uploading to the GPU.
回答3:
Just posting it as an alternative:
texture = new three60.THREE.Texture(video);
texture.repeat.set(-1, 1);
texture.offset.set( 1, 0);
来源:https://stackoverflow.com/questions/14052047/three-js-possible-to-flip-a-sprite