Hey, I’ve been playing around with JME for a while now, but found that i cant get simple 16x16 textures to render porperly on a face? i’m using 6 individual quads to make a square but the texture comes out all blurry! is it because of the size or because of something else?
[java] public void drawFront() {
Mesh mesh = new Mesh();
int x = Mx + 0;
int y = My + 0;
int z = Mz + 0;
Vector3f [] vertices = new Vector3f[4];
vertices[0] = new Vector3f(x,y,z);
vertices[1] = new Vector3f(x+3,y,z);
vertices[2] = new Vector3f(x,y+3,z);
vertices[3] = new Vector3f(x+3,y+3,z);
Vector2f[] texCoord = new Vector2f[4];
texCoord[0] = new Vector2f(x,y);
texCoord[1] = new Vector2f(x+1,y);
texCoord[2] = new Vector2f(x,y+1);
texCoord[3] = new Vector2f(x+1,y+1);
int [] indexes = { 2,0,1, 1,3,2};
mesh.setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(vertices));
mesh.setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(texCoord));
mesh.setBuffer(Type.Index, 3, BufferUtils.createIntBuffer(indexes));
mesh.updateBound();
Geometry geo = new Geometry("OurMesh", mesh);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Textures/Terrain/brick.png"));
geo.setMaterial(mat);
rootNode.attachChild(geo);
}[/java]