Log in or register to post comments

Building h.files for custom models

January 13, 2011 - 3:47am #1

Is there any recommendation for generation *.h-files for custom models ?

Multiple geometries on one marker

April 27, 2016 - 1:50am #16

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.

Building h.files for custom models

October 30, 2013 - 12:37am #15

A coworker of mine wrote it. I will write a note on the OpenGL forum! 

Building h.files for custom models

October 29, 2013 - 8:38am #14

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

October 29, 2013 - 7:40am #13

If you are using Blender you should check out the BlenderVuforiaExporter script, available at

https://github.com/StickyBeat/BlenderVuforiaExport

Re: Building h.files for custom models

March 24, 2011 - 6:05am #12

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

March 23, 2011 - 11:00pm #11

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

catarina_lopes wrote:

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

March 21, 2011 - 2:58am #10

@Sen

This is the page that helped me with this - http://vegastrike.sourceforge.net/wiki/HowTo:Radiosity_baking_in_Blender

Re: Building h.files for custom models

March 21, 2011 - 2:55am #9

Amongst ourselfs would be fine and beneficial.
We are all doing he same sorts of task so a few of us will have the same solutions and problems to help others.

Re: Building h.files for custom models

March 20, 2011 - 11:43pm #8

Hello everyone, for me also the same problem for so many days can anyone explain me about baking so that my object will render properly in the mobile. texture is not appearing plz help me it was very urgent to me.

Re: Building h.files for custom models

March 18, 2011 - 10:04am #7

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

March 18, 2011 - 9:41am #6

There seem to be a lot of issues with modeling and texture.
Seeing as 3D modeling is an integral part of AR what would be good is a forum area dedicated to that.

Re: Building h.files for custom models

March 18, 2011 - 6:11am #5

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

March 18, 2011 - 2:33am #4

You should look up something called "Baking"
I'm pretty sure thats how the texture was achieved on the teapot.

Re: Building h.files for custom models

March 17, 2011 - 8:52am #3

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

January 13, 2011 - 9:33am #2

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

Log in or register to post comments