- Sort Posts
- 15 replies
- Last post
Building h.files for custom models
Thanks for the notification - did you write this library?
Also you may want to post to the OpenGL forum as well.
https://developer.vuforia.com/forum/ar-technical-discussion/rendering-opengl-es
Building h.files for custom models
If you are using Blender you should check out the BlenderVuforiaExporter script, available at
Re: Building h.files for custom models
I would try running it in Cygwin. You'll need to grab the perl package first, if you haven't already. Run the Cygwin setup.exe, and click on the Perl package until it says Install. Install the package, then open a new Cygwin console before trying to run the script again.
- Kim
Re: Building h.files for custom models
Can anyone able to run this script in windows xp platform? I tried in windows xp command promt using following command
perl obj2opengl.pl cube.obj
but getting following error:
error in option spec: “centre=f{3}”
error in option spec: “ARRAY(01ad2c60)”
So can anyone help me to execuite this script in windows xp .
Thanks
Rassall
I am using that script, and it works fine. My problem is how to render to texture to bind in opengl. I am using 3ds and I can't find a way to render to texture like the ones in the samples. Can anyone help me?
Thanks
Re: Building h.files for custom models
Re: Building h.files for custom models
We can talk about creating a separate forum section for this, but it would mostly be a place for you guys to discuss amongst yourselves. 3D rendering with OpenGL ES is not really an AR-specific problem. Any mobile 3D application will have to deal with this.
Once your content is OpenGL ES-ready, we can answer questions about integrating it with QCAR. We can't really help with your content pipeline (modeling programs, creating textures, exporting geometry, etc.) I offer advice when I can, but it isn't something we officially support.
- Kim
Re: Building h.files for custom models
Yes, robertross is correct. I don't know how to do this in 3ds, but Blender has a pretty simple method of baking textures: http://wiki.blender.org/index.php/Doc:Manual/Render/Bake
The real trick comes with unwrapping your model. That's the step where you take all the vertices and map them to a 2D texture plane, without letting them overlap. These modeling programs have lots of tools to help, but it's really a trial-and-error process. Sometimes you have to unwrap your model in pieces, selecting a set of faces and unwrapping, then selecting another set, etc. In Blender (sorry, it's the only program I know anything about) there's a helpful "Pack Islands" feature that can take a bunch of separately unwrapped pieces and arrange them in a single texture space, avoiding overlap. After you unwrap you can bake the texture.
I'm hardly an expert on any of this, it isn't something we try to support here but I thought I'd share what I know. It'd be great if you guys could continue helping each other with these modeling/texturing issues as well!
- Kim
Re: Building h.files for custom models
We don't have any official recommendations, though many forum users have been using this perl script to convert a .obj file to a header file much like Teapot.h:
http://heikobehrens.net/2009/08/27/obj2opengl/
If you do use this script, please note that it does not produce an array of indices, and so you must use glDrawArrays rather than glDrawElements:
glDrawArrays(GL_TRIANGLES, 0, numVertices);
Could you let us know what modeling tool you are using? Thanks.
- Kim
Hello everyone along the forum.
I have a problem related to the old and boring (native-basis) subject of how to properly import and .obj geometry in scene.
I have a machinery tool with several parts and different textures assigned to them. More in detail:
Machinery_Canopy <--> Exterior_color.jpg
Machinery_Bench <--> Exterior_color.jpg
Machinery_Doors <--> Exterior_color.jpg
Machinery_Interior <--> Interior_color.jpg
My pipeline is:
1) Blender .obj exported to .h (with the https://github.com/StickyBeat/BlenderVuforiaExport addon) in parts
2) Inclusion of the .h parts in the JNI folder, from where they are linked from the renderFrame method.
3) Render of each part in the ImageTarget.cpp
My Android APP show the different geometries with its textured assigned right, but the problem comes with the spatial position/scaling of the parts, so they are shown displaced and even a little scaled from its original design in Blender.
Any clue about all this?
Thanks in advance!
P.S. The same out-of-place issue is experimented when using the http://heikobehrens.net/2009/08/27/obj2opengl/ approach, even executing the conversion in a OS X system.