Log in or register to post comments

Texture

June 10, 2011 - 6:12am #1

Hi,

I have some problems about the textures of the 3D objects.

In your samples, all your object are described in its .obj file, and its texture is in its .png file. The .obj is converted in a .h file which is placed in the project. The image of the texture is placed in the project too.

The problem is, when I use other 3D objects, some of them have their texture described in a .mtl file, and there is no .png image of thier texture. So I converted the .obj file into a .h file, and placed it into the project.

But how can I do to place the texture into the project?

Thanks,

Texture

February 3, 2013 - 5:46am #22

Thanks AlessandroB, let see if there is anyone can share the knowledge of how to convert .mtl file to .png:)

Texture

January 31, 2013 - 5:29am #21

About importing models and textures in Vuforia-based apps, here are a couple of articles you may want to read:

https://developer.vuforia.com/resources/dev-guide/adding-textures

https://developer.vuforia.com/resources/dev-guide/replacing-teapot

For the Blender (or Maya or 3D Studio Max) exporting part, this is beyond the scope of this forum as ksiva said in the previous message (but you are free to search this forum for other threads discussing similar topics).

 

 

Texture

January 31, 2013 - 4:05am #20

Same problem with dereklan. Really have no idea how can i handle mtl to png file and import with Vuforia SDK.

Texture

July 6, 2012 - 1:08am #19

Anyone could give a detail about how to use Blender to create( or transfer 3dmax file ) a 3D object with .obj file and jpg(png) texture ?

Re: Texture

May 13, 2012 - 7:30pm #18

You probably need to work on the UV unwrap of the model. Texture (UV) coordinates are required for mapping the texture onto the model. Unfortunately this is outside the scope of this forum.

- Kim

Re: Texture

May 12, 2012 - 9:13am #17

hi

i did the baking but i'm facing the same problem here

http://ar.qualcomm.at/node/2000365

can't get it fixed
plz help me

Re: Texture

May 11, 2012 - 11:30am #16

ohh yeh i did read about bakking but i forget, i'll try it

thank you

Re: Texture

May 11, 2012 - 11:18am #15

OpenGL doesn't work with .mtl files directly. You may be able to find a rendering engine that can work with them, but it would probably be easier to render your materials to a texture and use that. Look into "texture baking" for your particular 3D modeling tool.

- Kim

Re: Texture

May 11, 2012 - 10:58am #14

Hello

can you till me plz how to show the texture of an .mtl file in details

because all the 3d objects that i have don't have an image texture just .mtl file
or is there a way to get the texture in image format ?

thank you

Re: Texture

April 25, 2012 - 9:15pm #13

This is the coordinate system that the targets use: https://ar.qualcomm.at/resources/images/coordinateSystems.jpg

So Z is up. You should be able to change the export settings in your modeling tool to use Z up.

- Kim

Re: Texture

April 25, 2012 - 2:32am #12

Thank you very much for your help. It solved one part of the problem. The other one was, that i did the rotatePoseMatrix after the mulitplyMatrix, which hasn't any effect at all. Now everything works, though i don't understand why i have to use the rotateposematrix at all. Because when i create my model in blender and it is rotated correctly, why isn't it anymore in my app with openGL? It' like the axis are getting switched, or something like this. Maybe someone can give me a deeper Information on this, because it can be exhausting to adjust every 3d Model with rotatePoseMatrix, when you have many models like i will have in my app.

Re: Texture

April 24, 2012 - 6:35pm #11

Take another look at the rotatePoseMatrix method:

void
SampleUtils::rotatePoseMatrix(float angle, float x, float y, float z,
                              float* matrix)

The first parameter is the angle, the next three define the axis. Try rotating around one axis at a time, e.g. rotatePoseMatrix(90, 1, 0, 0, ...) would rotate 90 degrees around the X axis.

- Kim

Re: Texture

April 24, 2012 - 2:25am #10

I didn't enable Blend function, but now it works:

	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

I've got another question:
I made a 3d Model in Blender and the texturings works perfectly and it gets displayed correctly. But the 3d Model isn't rotated as it should be. Looks like the same problem with the horse model above. I tried to use the rotatePosteMatrix, but this didn't make any effect

SampleUtils::rotatePoseMatrix(90.0f, 1.0f, 90.0f, 0.0f,
                    &modelViewMatrix.data[0]);

I dont think that i did something wrong in Blender, as it gets rendered correctly (see attached renderpicture)

Re: Texture

April 23, 2012 - 4:18am #9

Could you post your renderFrame() code?

Re: Texture

April 10, 2012 - 4:43am #8

I am trying to show a simple plane with a partly transparent texture. So the post above should be exactly what i want, but unfortunately it doesn't work. I added the two lines glEnable(BLEND) etc. into the renderFrame() Method of the FrameMarker.cpp. The result is shown in the attachement. The black part of the plane should be completely transparent (aka showing what the camera actually sees). You can see the texture in the attachement too.
Any idea what i am doing wrong?

Re: Texture

June 17, 2011 - 6:52am #7

[QUOTE=robertross" />If you are using Blender you can export the file to an obj and select the "triangulate" option. This can then be converted to header files using the popular obj2opengl converter.[/QUOTE" />

ok, now it works, thanks!

Another problem, linked to texture, is about transparency...
I remembered I could put a half-transparent texture for the sample's multiTarget box (and it works, I could see the real box through the texture). But in my current application (based on ImageTarget), it becomes black.
Do you know if the .obj file contains some data about the transparency?

-----------------------
I solved it! 2 lines had to be added id cpp file (RenderFrame method)

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Re: Texture

June 15, 2011 - 7:39am #6

If you are using Blender you can export the file to an obj and select the "triangulate" option. This can then be converted to header files using the popular obj2opengl converter.

Re: Texture

June 14, 2011 - 2:25pm #5

These models were probably exported using quads. OpenGL ES expects triangles. Use a 3D modeling program to triangulate the models.

- Kim

Re: Texture

June 14, 2011 - 3:13am #4

Well, I'm wondering if it is not a problem due to triangle faces...

Re: Texture

June 14, 2011 - 2:22am #3

Ok, I don't know what's wrong!

I found some .obj objects on the Internet, I converted them into a .h file, and here is the result (attached file)
It seems that the object is incomplete!

I thought at the beginning it was a problem with textures, but I'm not that sure right now. As I said, I have the impression that some faces are missing...

Did anybody encounter this problem?

Thanks

Re: Texture

June 10, 2011 - 6:29am #2

OpenGL ES doesn't know anything about .obj files or .mtl files. You need to get your model/material data in a form that you can feed to OpenGL. We chose a .h file containing arrays for the model data, and easy-to-load .png/.jpg files for the textures. You may be able to find a 3rd party solution that can deal with other formats.

Check to see if your modeling software can produce an image file instead of a .mtl file.

- Kim

Log in or register to post comments