Log in or register to post comments

User defined target scene width

April 11, 2016 - 1:30am #1



I have a scale problem in my application. Here are the facts :

I had previously a classic Image Target, that I created on your website. It was a square picture, and the given width was 40 (cms, but it doesn't matters).

As I create my own 3d objects, my scales were good and the rendering was perfect, considering the 3d model/target width ratio . I mean that if I model an object of 40 scene units, it covers just the image target.

Now I am using a user defined target. I upgraded my environment, and now I am trying to test the scale during the rendering. I am rendering in landscape mode, and my screen is 1280 px in width by 720 px in height (important for the result).

I did the following test :

- I printed my previous square image target

- I aim to it with my application, making the printed target height to match with my screen height, so it takes all my screen height. There is some space on both sides, my target being a square..

- I press the button "make target"

- When building it, the scene width parameter of the method "targetBuilder.build" is set to :  40.0* (1280.0 / 720.0)

The result is that my rendered object is really bigger than the target.

When invoking the method "targetBuilder.build", I assume that your sceneWidth parameter correspond to the width that I want to give to the picture present on my screen. I mean that I will create a frame target, and its ratio will correspond to my screen ratio.  Am I right ?

I hope you understand what I wanted to explain.

Thanks for your answer, have a good day.

User defined target scene width

April 11, 2016 - 8:49am #3

I have an other issue.

It looks like when using the user defined target, the rendered object is bigger comparing to the target when I am far from the target, and the size of the rendered object is smaller when detecting the target from closer (i don't rebuild the target between the two observations).

Did you ever experience the target being detected bigger than it really is with some distance (maybe fewer details) ?

Thank you,


User defined target scene width

April 11, 2016 - 1:50am #2

After a few hours of searching the origin of the problem, I just had to ask for the solution to find it by myself.

It's hard to tell if the scale is exactly respected, but it seems right now.

I used the vm.getWidth() and vm.getHeight() (from VideoMode) to calculate the ratio for my targetBuilder.build scene width.

The answer was not using 40.0 * (mScreenWidth/mScreenHeight), but 40.0 * (vm.getWidth() / vm.getHeight()).

I assumed the screen ratio and video ratio were not the same by looking into the configureVideoBackground method.

Thanks anyway, have a great day.

Log in or register to post comments