我有一个可在桌面上运行100%的Lib Gdx游戏但是当我在Android上运行它时,运行时生成的背景网格不会渲染。
或者至少纹理没有显示在它们上面。
任何想法都是适当的!
相关代码:
ModelBuilder r;
this.r.begin();
MeshPartBuilder meshBuilder = r.part("1", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.TextureCoordinates,new Material(TextureAttribute.createDiffuse((new Texture(l.get("letolt.png",Pixmap.class))))));
meshBuilder.patch(-100f, -120f, -100f, -100f, -120f, 100f, 100f, -120f, 100f, 99.999f, -119.12f, -99f,0f,2f,0.1f ,2,2);
MeshPartBuilder meshBuilder1 = r.part(" ", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.TextureCoordinates,new Material(TextureAttribute.createDiffuse((l.get("bge.png",Texture.class/* .class*/)))));
meshBuilder1.patch(-100f, -1f, -100f, -100f, -1f, 100f, 100f, -1f, 100f, 99.9999f, -0.98f, -99f,0f,2f,0.1f ,1,1);
meshBuilder1.patch(-100f, -3f, -100f, -100f, -3f, 100f, 100f, -3f, 100f, 99.999f, -3.999f, -99f,0f,2f,0.1f ,1,1);
backgroun = new ModelInstance(this.r.end());
backgroun.transform.scl(100,50,100);
backgroun.materials.get(0).set(new BlendingAttribute(0.99f));
backgroun.materials.get(1).set(new BlendingAttribute(0.22f));
(backgroun.materials.get(0).get(TextureAttribute.Diffuse))).textureDescription.uWrap=TextureWrap.Repeat;
((TextureAttribute)(backgroun.materials.get(0).get(TextureAttribute.Diffuse))).textureDescription.vWrap=TextureWrap.Repeat;
((TextureAttribute)(backgroun.materials.get(0).get(TextureAttribute.Diffuse))).scaleU = 2;
((TextureAttribute)(backgroun.materials.get(0).get(TextureAttribute.Diffuse))).scaleV = 2;
((TextureAttribute)(backgroun.materials.get(1).get(TextureAttribute.Diffuse))).scaleU = 100;
((TextureAttribute)(backgroun.materials.get(1).get(TextureAttribute.Diffuse))).scaleV = 100;