Problem importing .obj / .mtl (exported using blender) into my OpenGL view
Hi,
i have a problem when trying to import a blender-generated .obj/.mtl into my OpenGL view.
The problem is the that the textures are not how they should be.
I append a picture of the object in my Opengl view and how it is displayed in blender.
If you want i can upload my code, just tell me which part you need.
I tried to fix / understand this for a long time, but as im only starting with openGL...
i THINK it is a problem with negative texture coordinates. Still im not sure how to handle it.
http://i45.tinypic.com/2exucu0.png
http://i47.tinypic.com/332b0py.png
Quote:
# Blender v2.63 (sub 0) OBJ File: 'quad_UV.blend'
#
www.blender.org
mtllib quad_UV.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 0.000000 0.000000
vt -0.000000 -1.000000
vt 1.000000 -1.000000
vt 1.000000 0.000000
vt -1.000000 0.000000
vt 0.000000 1.000000
vt -1.000000 1.000000
vt 1.000000 1.000000
vt -1.000000 -1.000000
usemtl Material_BrownBrickWall_tileable.jpg
s off
f 8/1 7/2 6/3
f 5/4 6/1 2/2
f 6/4 7/1 3/2
f 4/1 3/5 8/6
f 5/4 1/3 8/1
f 4/1 1/4 3/2
f 5/6 8/7 6/1
f 1/1 5/6 2/5
f 2/1 6/6 3/5
f 3/1 7/6 8/8
f 8/6 1/4 4/1
f 1/1 2/2 3/9
Quote:
# Blender MTL File: 'quad_UV.blend'
# Material Count: 1
newmtl Material_BrownBrickWall_tileable.jpg
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd BrownBrickWall_tileable.jpg
Having the same problem but no solution
Quote:
Originally Posted by
fp13__
Sorry for bringing this up again. I solved the above problem (it was due to a major misunderstanding of one of the opengl functions).
But do you / does anyone know a good loader for .obj/.mtl files or other files in general? I did some research in the internet but found no loader with a good documentation.
I'm having the same problem. Could you elaborate what the problem was you had?
Sincerely,
H.P.