How can I tell if OpenGL importable format - (2 files - an obj file with v, vt, vn, and f (indice) listings and a texture file

Discussion started by androidgamecoder

I've bought items that I haven't been able to use as the obj file doesn't include everything I need to load the object into OpenGL. The obj file of my last one Model ID: 989825 only had vertice data and indices for just the vertice data. I need v (vertice), vt (texture), vn (normals), and f indice triples tying them together such as:

v 1.683100 3.085200 -0.979200
***
vt 0.565929 0.431484
***
vn 0.742515 -0.546617 -0.387097
***
f 15705/1/15705 20321/2/20321 20322/3/20322
***
The last few models I've purchased only had v (vertice) coord listing and f listings like this:
v -0.02509399 -1.80899996 -0.10240404
***
f 27122 27119 27118
***
I expect that is to make triangles with the vertices. I could create my own 90 degree normal coords out of this programmatically, but without corresponding texture coords I could only make black textureless models.

Is there any way to tell if models are OpenGL compatible before purchase? OpenGL is not included in the file format listing.

Answers

Posted 5 months ago
0

OpenGl is not file format.

Vt - is UVs information. You can tell if model has UVs in the 3D Model details - UV Mapping. If your bought model says it has UV Mapping and you don't have Vt in OBJ it was incorrectly exported and you should contact the seller.

Vn - for normals, should be included in most of the models on this site. Only kind of a models that don't need this information I can think of are hi poly printable models, or maybe some kind of hipoly jewerly maybe.

I don't know what kind of models you bought but you can download Blender.. it's free. Import your OBJ, then Export it.. it will have at least Vn information. If you want smooth normals, rightclick on the object - click Shade smooth and then export OBJ.

If you want also Vt you can do some simple UV unwrapping in Blender. Look at youtube for some simple tutorial for basic UV unwrapping in Blender. You can do it by yourself.

Posted 4 months ago
0

This is the best answer I've gotten. As mentioned, I can create 90 degree normals programmatically, but no vt info is fatal. I guess there isn't high demand for obj files as typically they haven't been complete, and modelers don't seem to know what I'm talking about when I try to explain what's missing. one particular modeler always has negative f values, like
-15705/-143/-15705 -20321/-223/-20321 -20322/433/-20322
just as an example of the weird things I've dealt with.
I eventually figured out on my own what to add to those numbers to correct this, although it's messy to explain what has to be done there.
I haven't had time to learn Blender or other graphics software but I probably should. I'm introducing purchased models to my OpenGL Google Play game, so will ultimately be buying about a hundred of them from here.

Your answer

In order to post an answer, you need to sign in.

Help
Chat