Author Topic: problem with texture tile  (Read 610 times)

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
problem with texture tile
« on: January 05, 2016, 10:18:44 am »
i found texture tile to be not precisely repeating:
i have a plane created by

plane=ExtendedPrimitives.createPlane(4096,20); ExtendedPrimitives.transformUVCoords(plane,0,0,256,256,0,0);
tex.setClamping(0); plane.setTexture(tex); plane.compileAndStrip(); plane.build();

texture image size is 256x256.
say i look at position (0,0,0) of the plane, i see some part of the texture. then i translate the plane to (4096,0,0), in theory i should see the same texture, but i saw the texture changed. no matter what parameter i put into the transformUVCoords call. i don't know why.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: problem with texture tile
« Reply #1 on: January 05, 2016, 10:29:50 am »
problem solved. i found the scale parameter should not be power of 2, but should be (20 * n)
this works correctly now: ExtendedPrimitives.transformUVCoords(plane,0,0,240,240,0,0);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: problem with texture tile
« Reply #2 on: January 05, 2016, 10:53:28 am »
I wasn't even aware that this method exists...(ExtendedPrimitives is a third party addition, not my own stuff)... ;D