I’m going to create 9 identical card tiles with the same texture. But I only see the single card (I can say it by investigating the coordinates).
self.texWidth = 425 self.texHeight = 315 tex = loader.loadTexture("6.jpg") for i in range(-1, 2): for j in range(-1, 2): x = self.texWidth * i y = self.texHeight * j cm = CardMaker('ground_%s_%s' % (i, j)) cm.setFrame(x, x + self.texWidth, y, y + self.texHeight) ground = render.attachNewNode(cm.generate()) ground.setTexture(tex) ground.setPos(x, y, 0) ground.lookAt(x, y, -1) self.cube = self.loader.loadModel("cube.x"); self.cube.reparentTo(render) self.cube.setScale(4) self.taskMgr.add(self.loop, "loop") def loop(self, task): x = 30 * task.time y = 30 * task.time x %= self.texWidth y %= self.texHeight self.cube.setPos(x, y, 30) base.camera.setPos(x - 50, y + 30, 70) base.camera.lookAt(x, y, 20) self.title.setText('%s; %s' % (int(x), int(y))) return Task.cont
The idea is that the camera is set that initially we only see part of the central card. As time passes the cube moves. When it approaches the borders of the central card we should see adjacent cards making it look like if the plane is infinite.
And as we cross the edge I reset the coordinates jumping back to the origin.
What actually happens: I can see that additional cards are there in the space, but
- they are not adjacent - there are big gaps between them
- their sizes are less than the given self.texWidth, self.texHeight, though these are numbers that are real picture dimensions. I assume this poing can be the reason of 1), though it looks like the spacing is much bigger than the actual difference between the visual edge coordinates and the texture image size.