How to load texture inside file .obj.

Started by tinhtinhcd, May 19, 2017, 10:57:40 AM

Previous topic - Next topic

tinhtinhcd

Hi,

My app load object from file .obj.
Inside the .obj also contain texture


vt  1.000000 0.011329 0.000000
vt  1.000000 0.011329 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.975610 0.000000
vt  1.000000 0.975610 0.000000


how can i load that texture.


tinhtinhcd

Hi,

I don't get it, in that example need to create a texture from a png file.
Texture skinTex=new Texture("textures/dogtex.png");
But I don't have that .png file, I only have the .obj.

EgonOlsen

OBJ file are ASCII files. They don't contain any texture data. They contain texture coordinates, but these are just pointers into a texture. You have the provide the texture file somehow.

tinhtinhcd

Thanks EgonOlsen,

It is first time I work with 3D object, so I don't know it.