Author Topic: How to use uv-texture  (Read 400 times)

Offline lanslot

  • byte
  • *
  • Posts: 11
    • View Profile
How to use uv-texture
« on: January 19, 2016, 08:26:04 am »
i load a model,when i want to load a texture to it, i don't know why the uv is wrong.
my english is not good ,i hope you can understand.

Code: [Select]
Texture texture = new Texture(getResources().getDrawable(R.mipmap.body_d));
TextureManager.getInstance().addTexture("texture", texture);
 try {
                    model = Object3D.mergeAll(Loader.load3DS(getAssets().open("objs/hk.3ds"), 1));
                } catch (IOException e) {
                    e.printStackTrace();
                }
                model.setTexture("texture");
                model.calcTextureWrapSpherical();
                model.strip();
                model.build();


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: How to use uv-texture
« Reply #1 on: January 19, 2016, 08:39:27 am »
Remove this line:

Code: [Select]
model.calcTextureWrapSpherical();

It creates new texture coordinates based on the vertex normals. It's fine for simple models that don't have any, but not in this case.

Offline lanslot

  • byte
  • *
  • Posts: 11
    • View Profile
Re: How to use uv-texture
« Reply #2 on: January 19, 2016, 08:49:16 am »
Remove this line:

Code: [Select]
model.calcTextureWrapSpherical();

It creates new texture coordinates based on the vertex normals. It's fine for simple models that don't have any, but not in this case.

thank you for your reply~ :D