"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

obj 2 opengl

Hello, I am starting to use Vuforia, and I would like to use my own 3D Model instead of the TeaPot, so I have tried the script "obj2opengl.pl" to transform my .obj into a .h file. But it turns that the final ".h file" has only a Verts and TexCoords, but no Normal or Indices like the Teapot or the Banana example. So when I play it, it doesn't show any texture. Is there other way to transform .obj 3D models into .h file? Is there other way to produce a 3D model into a .h file? I am sorry, I know this is a very repeated topic but I don't find any final solution to this problem. Thank you so much

Which program do you use to export your .obj model? If you use Blender for the export, do the following checks: [LIST] [*]Edges [*]Normals [*]High Quality Normals [*]UVs [*]Materials [*]Triangulate [*]Apply Modifiers [/LIST] For your indices use this value inside of your object .h file "unsigned

jorgefundacionctic

Tue, 03/20/2012 - 11:45

Hello Sceada, thank you so much. Everything works more or less as expected :) These are the options that I could check [IMG]http://i44.tinypic.com/6ejkok.png[/IMG] Are you producing your 3D Models in Blender and then using the obj2opengl Pearl script? Or are you using a different way?

Hi, nice to hear that the transformation works. I use Blender too!

Khaled1989

Wed, 03/28/2012 - 08:56

[QUOTE=Sceada]Hi, nice to hear that the transformation works. I use Blender too![/QUOTE] How can you generate .h file by blender?!!!

Hi, as I know it isn't possible to export directly to a .h file. First you have to export your Object into a .obj file (Only static Objects can be stored in an .obj file).

Khaled1989

Wed, 03/28/2012 - 09:24

I already used obj2opengl script but it don't solve my problem because it doesn't generate all arrays (numVertices, vertices, normals, texCoords, numIndices, indices) like "teapot.h" example please tell me how i display the banana object used this .h file?

Use glDrawArrays instead of glDrawElements: [CODE] glDrawArrays(GL_TRIANGLES, 0, numVerts); [/CODE] In that case you don't need indices. - Kim

Khaled1989

Thu, 03/29/2012 - 11:39

[QUOTE=ksiva]Use glDrawArrays instead of glDrawElements: [CODE] glDrawArrays(GL_TRIANGLES, 0, numVerts); [/CODE] In that case you don't need indices. - Kim[/QUOTE] Thank you Mr.ksiva i'm do that and the project has been built successfully ... but when i run the project and detect the target ma

Perhaps you're overrunning your arrays (causing an array out of bounds exception)? For instance numVerts in the snippet above is the number of vertices, not the size of the vertex array. - Kim

I think I'm having issues related to this. Trying to export from blender. The application runs. And I get the shape but its very jaggy and broken looking. Is it ok for me to use the teapot texture on another model? I dont have high quality normals as an option on my version of blender