LWJGL 3.2.3 released
Lightweight Java Gaming Library
January 11, 2015, 08:12:21 »
I have been having problems loading .obj in to my project.
I'm using the model loader as used here:
and it works great until the models have textures. I have tried to use the createTexturedDisplayList() and loadTexturedModel() methods thought they have just given my really weird shapes and no visible texture.
This is the only thing I could find on .obj files:
and it is not much use.
How would I use texture obj models and does any one have a loader that works with them?
thanks in advance,
Re: OBJ loader
Reply #1 on:
January 11, 2015, 13:30:41 »
Not really much to go on as you haven't actually posted any of your own code. Some questions for you
1) Have you written anything before that loads a texture and displays that in opengl? If the answer is no, go do this so you understand what to do (There are plenty of tutorials on how to do this), if yes then use this as a working example
2) Do you understand the the .obj file format? Its quite simple (
), if you have some example code that loads textures successfully in opengl then you just need to map everything from .obj file format to the way you drew it befoew
Re: OBJ loader
Reply #2 on:
January 15, 2015, 11:14:05 »
I wrote my an obj reader for my own engine based off that same video, and haven't had any issues.
Could you at the very least post a screen shot of this "really weird shapes and no visible texture" and possibly the .obj file?
Your comment leads me to believe that it has incorrectly parsed the obj file, the vertex ordering sounds wrong, that's what usually gives you a weird pointy model.
Also, is the model your own or one you have exported your self? With blender you have to make sure to check all the right settings before exporting ("include normals" and "include uvs")
SMF © 2014