Log in or register to post comments

Video changing size when playing both video and 3D model

December 13, 2012 - 6:27am #1

When I am playing my video WITHOUT tracking the 3D model, then I have no problems. The video is the correct size and everything.

However, when I am playing the video and begin tracking my 3D model, then the video size is too big and I can only see a very small part of the video.

I have tried to merge the playback sample with the imagetarget sample, but it cannot get the size fixed.

A link to my java code and c++ code can be found here: https://skydrive.live.com/redir?resid=80766714248E0F0!305


I am in a hurry as I have to send the app to the appstore before monday.

Hopefully you guys can help :)


You're welcome, glad to hear

December 20, 2012 - 3:07am #5

You're welcome, glad to hear that it was solved !


December 19, 2012 - 11:59pm #4

Hi alessandro.

I got it working, it was because of an overseen if, which had some old check. And possible the other things you pointed out :)

I am very sorry for the state of the code I send, it was in no shape for a forum question, it only happend because of time pressure.


Thank you very much for taking the time to look at it, even thoestion wasn't very friendly.

Hi, I had a look at your code

December 14, 2012 - 7:07am #3

Hi, I had a look at your code and created an Eclipse project out of it; 

(I had to change it quite a bit as you were using absolute storage and other extra stuff that I did not want to have for a quick testing; maybe next time please share code that can be easily compiled using the sample reources, such as the sample videos and textures, otherwise it takes so long....)

Also, I also had to change the target names so to use "chips" and "stones" and the StonesAndChips dataset;

however the changes above are not relevant (i.e. should not affect your issue);

but everything seems to work fine, I can see a nicely textured christmas ball floating (and slowly rotating) above the target, and the video dimensions always look good (matching the target size);

I can presume that the problem might come from the fact that on certain devices there might be some wierd "conflict" when using many different shaders in OpenGL;

what I would suggest to try is the following:

- at the beginning of your _renderFrame function, make sure to reset all the "modelview" matrices to an Identity matrix; you can do this by using the function SampleMath::Matrix44FIdentity(); note: do this only for the "modelview" matrices, NOT for the projection one.

- near the end of your _renderFrame() function, just before the line "SampleUtils::checkGlError("ImageTargets renderFrame");", add the following line of code:


This is a very important one (especially if you are using more than one shaders, like in your case).

The above might fix the problem.





Hi, let me have a look at

December 14, 2012 - 1:55am #2

Hi, let me have a look at your code and get back to you.

Meanwhile, if the problem only occurs when you render the 3D model, you can check to see if you are using the same modelview matrix in different places and/or if you correctly set all the shader "uniform" parameters.


Log in or register to post comments