Real sorry, I believe this is quite a simple thing, its just that I’m not too sure how the texture thing works…
I’m trying to get a tiling texture working, where i have this HUGE thing, and I want the texture to constantly repeat itself instead of stretching itself to the full size.
max() is a Python function that returns the highest value of a list of values. If you want the two highest values, you have to sort() the list, and then get the last two values in the list.
another way:
uv-map a small piece of your model and set the wrap mode to REPEAT. i usually do this in the egg file with the following line inside a texture section:
I currently made a tiny system for my game which allows me to use crates, and extend it out to make the level fo the game simply. What it does is that it just finds the distance between the two, repositions a crate in the middle, and scales it out to that distance, to create a wall.
But the thing is, when I do that, the textures on it screw up, using my code.
Can someone give me tips as to how to fix this? The code that I currently have for that bit is:
self.tex = loader.loadTexture(MYDIR + '/' + self.TYPE + '.jpg')
self.model.setTexture(self.tex)
self.model.reparentTo(render)
if (self.type != "LockedDoor" and self.type != "Door" and self.type != "Board"):
scaleList = [self.xScale,self.yScale,self.zScale]
scaleList.sort()
self.model.setTexScale(TextureStage.getDefault(),xScale/2,yScale/2)
self.model.setPos(self.xPos,self.yPos,self.zPos)
setTexScale/Offset() have misleading names. They actually apply the value as it is, as if their names are setUvScale/Offset.
So, maybe you want to multiply by 2 instead.