Rotating Texture and transparent png texture

Hi guys,



i found the Texture.setRotation() method and it works fine, but how can i rotate a texture around a specified point ?

Normally the texture will be rotated around the first texture coord. I'm using WrapMode.BorderClamp and setScale and setTranslation to adjust size and position of the texture. Also i use multi pass rendering to show a lot textures on one quad.



Also i have some trouble with png's (Alpha channel) and Quads. I dont really know what i need to change to use this alpha channel. (Multipass rendering… ) And what about jpg textures ? Is it possible to make them "half" transparent?



Chris

Hi, I got nearly the same problem.







I got a terrain with a texture, as you can see, the texture needs to be rotated.



I my opinion, the texture needs to be rotated around the x axis for 180 degrees.



Texture t = TextureManager.loadTexture(groundtex, Texture.MinificationFilter.BilinearNearestMipMap,
            Texture.MagnificationFilter.Bilinear);
Quaternion q =  new Quaternion();
q.fromAngleAxis(FastMath.DEG_TO_RAD * 180, Vector3f.UNIT_X);
t.setRotation(q);


This doesn't work.

Can somebody help me?

You don't need to rotate te terrain you just need to reate the texture coordinates

juglarx said:

You don't need to rotate te terrain you just need to reate the texture coordinates


My code should rotate the texture, shouldn't it?

I've solved the problem by setting the textureaxis to horizontal.



TextureState ts = display.getRenderer().createTextureState();
         Texture t = TextureManager.loadTexture(texture.toURI().toURL(),
               Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);

         ts.setTexture(t);
         Quaternion rotation = new Quaternion();
         rotation.fromAngleAxis(FastMath.DEG_TO_RAD*90, Vector3f.UNIT_Z);
         t.setRotation(rotation);
         t.setWrap(WrapAxis.S,WrapMode.Repeat);



greetings
Edregol