Repeating a texture

Hi!



I'm trying to understand 'KeyInput' from the tutorial guide. My problem is that I want to replicate a texture over a Box and I can't understad how the textureBuffer works. Can anybody tech me?



This is the code where the texture appears just one time:


2 ways to do this:

  1. use texture matrix: t.setScale(new Vector3f(0.25f,0.25f,1f));
  2. use texcoord scaling: Floor.copyTextureCoords(0,0,0,0.25f);

And…why this numbers?



t.setScale(new Vector3f(0.25f,0.25f,1f));



Thank you.

That just means it will repeat 4 times for every original one. You can put any value in here you want. Like for your 32 unit box you could set the scale to 1/32.

Thank you. It is very useful.

How should the HelloKeyInput example look like ?  :?



here is what I get: http://xs226.xs.to/xs226/08176/wrap342.jpg



Cause in my case there is no texture repeating (weirdly, I think it worked some month ago for me).



Also in my project I try to repeat a texture on a Quad and impossible.


to repeat 5 times in every direction:

t.setScale(new Vector3f(5,5,5));

Still doesn't change anything  :expressionless: . Also, what about HelloKeyInput.java you can find in jME's source where there is a quad that is supposed to have a repeated texture ? (doesn't repeat for me…)



Thanx !

may anyone could please just run the HelloKeyInput.java example and tell me if the texture is repeating as expected ?  thanks !

i did change it in HelloKeyInput and it works as expected :slight_smile:

oooh ok so there's this scale modification to make it work. Just tried on the Hello example and it works. Now I just have to figure out why it doesn't work in my project.



Thanks for your help Core-Dump !



(Off-board but as you're swiss, just to say it's a shame Federer didn't bring the cup back to Switzerland  :expressionless: !)