texture tiling?

Started by jcoy, November 03, 2005, 02:21:20 AM

Previous topic - Next topic

jcoy

How can I enable texture tiling when creating Object3Ds directly (meaning not using Loader)?

I'm trying to build some simple rectangles by making 6 planes with the following:


 public void addPlane(Object3D obj3D, SimpleVector v1, SimpleVector v2, SimpleVector v3, SimpleVector v4, int textureID);
   obj3D.addTriangle(v1, 0, 0, v4, 1, 0, v2, 0, 1, textureID);
   obj3D.addTriangle(v4, 1, 0, v3, 1, 1, v2, 0, 1, textureID);
 }


The problem I am having is it "streches" the texture to fill the plane.  Is there a way to make it tile the texture instead?  The problem is the rectangles will be different sizeses and we are trying to get a "uniformed"  look .  The texture is a simple 256x256 jpeg.

EgonOlsen

You can use u/v-coordinates greater than 1 or below zero. For example 3 instead of 1 in your example should "triple" the texture onto the polygon.

Anonymous

Quote from: "EgonOlsen"You can use u/v-coordinates greater than 1 or below zero. For example 3 instead of 1 in your example should "triple" the texture onto the polygon.

Perfect!  Thank you very much for the speedy reply and an excellent tool!