Log in or register to post comments

Different coordinates between editor and android app

August 5, 2012 - 9:06am #1

Hi,

I am testing an app with a GameObject attached to the camera and I noticed that the coordinate system between the real app and the editor is way different. 
Is it a know bug?

I thought it was a problem of aspect ratio, but I printed out the camera size and made it exactly the same on the editor, and they are still way off.

As a last test I made the object centered in the camera, and made a button to move the object slightly to the right every time. On the editor I need 15 click, on the device 9, exactly the same number if I set the scene with a square aspect ratio. Is there any setting I should set for the coordinates ? 

Different coordinates between editor and android app

September 28, 2016 - 12:49pm #8

Hi,

Am facing the same issue. Any solution you got on this? Any guideline will be much appreciated.

Thanks.

Different coordinates between editor and android app

August 9, 2012 - 1:10pm #7

Have you tried using Camera.main.ScreenToWorldPoint to position your object?  If you set the Vector3 to a simple math function that places your object in the correct position regardless of device/resolution (like some % of the screen.width for example).

I have used this technique with great success in a couple different QCAR/Unity apps.

Different coordinates between editor and android app

August 7, 2012 - 5:12pm #6

What I mean is that the area of the camera viewport actually extends past the boundaries of the screen, though the aspect ratio is unchanged. Though I wonder if this is not the issue that you're encountering. Can you send me screen grabs of what you're seeing? And how far is your object from the ARCamera? I'll test what you're describing on my side.

Different coordinates between editor and android app

August 7, 2012 - 9:02am #5

 

If by stretched you mean a different aspect ratio, this is not the issue here. The object take a totally different position from the camera, in some cases it even go out by far, and I made the camera preview same size as the device and I still have the problem.

You can try by yourself by putting any object very near to the camera, it will never look the same as the unity editor.

Also I noticed the field of view setting of the ARCamera is totally ignored in the device, this may explain the mistmatch.

I am trying to have a first person view with some object attached to the camera, sort of like this :

http://www.youtube.com/watch?v=dXpZ7niGgIY

 

 

Different coordinates between editor and android app

August 7, 2012 - 8:47am #4

The viewport used by the camera is stretched a bit, in relation to the screen space, which may explain what you're seeing. What are you trying to accomplish?

Different coordinates between editor and android app

August 5, 2012 - 9:58am #3

I found a temporary solution. A camera field of view value of 35 produce similar results in the editor as my Asus Transformer, don't know if it's specific for this device or same for every device.

Different coordinates between editor and android app

August 5, 2012 - 9:45am #2

I think there is some issue with the field of view of the camera. I tried to make it very large so that the object would seem far, but I got the opposite effect with the object rendered very near. 

Log in or register to post comments