www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: MichaelJPCT on January 05, 2016, 10:18:44 am

Title: problem with texture tile
Post by: MichaelJPCT 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.
Title: Re: problem with texture tile
Post by: MichaelJPCT 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);
Title: Re: problem with texture tile
Post by: EgonOlsen 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