www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: tinhtinhcd on May 19, 2017, 10:57:40 am

Title: How to load texture inside file .obj.
Post by: tinhtinhcd on May 19, 2017, 10:57:40 am
Hi,

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

Code: [Select]
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.
Title: Re: How to load texture inside file .obj.
Post by: EgonOlsen on May 19, 2017, 02:16:42 pm
Like so: http://www.jpct.net/wiki/index.php?title=Loading_models (http://www.jpct.net/wiki/index.php?title=Loading_models)
Title: Re: How to load texture inside file .obj.
Post by: tinhtinhcd on May 22, 2017, 05:02:07 am
Hi,

I don't get it, in that example need to create a texture from a png file.
Code: [Select]
Texture skinTex=new Texture("textures/dogtex.png");But I don't have that .png file, I only have the .obj.
Title: Re: How to load texture inside file .obj.
Post by: EgonOlsen on May 22, 2017, 10:02:35 am
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.
Title: Re: How to load texture inside file .obj.
Post by: tinhtinhcd on May 22, 2017, 11:28:12 am
Thanks EgonOlsen,

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