Log in or register to post comments

3D engine Irrhlict with Qualcomm AR

March 22, 2011 - 11:54pm #7


I am playing with Qualcomm AR and try to make it work with a 3D engine "Irrhlict", using the ImageTarget as the base. I am able to make the animated 3D model (md2 format) displayed on my Nexus One but not able to display its texture. The model looks like as if it is made of glass, the texture is replaced by the camera feed. I am wondering if Qualcomm AR set something special that causes that. The 3D model works fine by itself.

here is a link the a screen shot:


Re: 3D engine Irrhlict with Qualcomm AR

March 23, 2011 - 3:20am #6

This tends to happen if you don't bind the texture properly in OpenGL ES.
I think it's a result of it's state machine nature.

You'd best check your code and look for glBindTexture.

Re: 3D engine Irrhlict with Qualcomm AR

March 24, 2011 - 11:28pm #5

I realize that is not adding this line the 3D model has correct texture:

QCAR::State state = QCAR::Renderer::getInstance().begin();

but after adding it, the texture becomes the live camera feed:

any idea??

Re: 3D engine Irrhlict with Qualcomm AR

March 24, 2011 - 11:59pm #4

and even I call "QCAR::Renderer::getInstance().end();" right after that "begin" statement but before my 3D model rendering code, it still not render the texture correctly, it still wrap my model with the live camera feed...

Re: 3D engine Irrhlict with Qualcomm AR

March 25, 2011 - 5:24am #3

QCAR::Renderer::getInstance().begin() is the point at which the live camera image is rendered to the background. You will need to bind your textures for rendering after this point. It's also possible you will have to reset a few texture parameters if Irrhlict expects a specific setup.

- Kim

Re: 3D engine Irrhlict with Qualcomm AR

April 5, 2011 - 9:06am #2

I am currently trying out another 3d engine called "jpct". I am able to render the camera feed and the 3d model has texture. But another problem i have now is that the "depth" of the model vertices is not right when rotated. Say a model is holding a sword, so when it rotates the sword is supposed to be hidden behind the body, but it doesn't do that. Same thing happens for other body parts. If I disable the camera rendering line then it will go back to normal.

Another question I have is regarding the modelview matrix created by QCAR when a trackable is detected. Most 3D engine uses the "camera" object to look around a world. So how do I convert that modelview matrix and apply that to a 3D engine's "camera" object?? I try to directly apply it but it doesn't work right, when I move the camera to the right, the model seems to move to the same direction.. same with other directions.

Do you know any 3D engine that will work out of the box?? thanks!

Re: 3D engine Irrhlict with Qualcomm AR

April 6, 2011 - 6:24am #1

For the depth issues, make sure that glEnable(GL_DEPTH_TEST) is set. Note that our sample projects set this to false at the end of the renderFrame native method. Also note that our samples automatically clear the depth buffer at the start of a frame, with this line (also in renderFrame):


For the modelview problem, try taking the inverse of the modelview matrix and using that for the camera. There is a matrix inverse function in the Dominoes sample. Also make sure that you are passing the matrix in the format the engine expects (row-major vs. column-major).

I suspect that integrating any 3D engine is going to take a bit of interfacing effort, but once you get it working it should be worth it!

- Kim

Log in or register to post comments