Log in or register to post comments

Virtual Button Calculation

December 19, 2014 - 3:57am #1

Hello Vuforia Developers,

Does anyboydy knows, How to calculate Scaled Target Coordinates from Original Coordinates of virtual buttons using Android Native Java API?

 

 

Virtual Button Calculation

December 24, 2014 - 12:53am #2

the Original Image Coordinates are in pixels fo the original image, whereas the Scaled Image Target coordinates are with respect to the target size (with origin in the center of the target);

so, you need to:

- subtract the center-point coordinates (pixels) of your image, so that you get a sect of coordinates represented with respect tot he center of the image

- normalize the coordinates by dividing by the image size, so that you get coordinates in range [-1, 1]

- multiply the normalized coordinates by the image target size (as defined in the dataset XML), so that you have the coordinates in 3d scene units

- also, you will need to flip the vertical coordinate, as the image taregt Y axis is pointing upward, whereas the original image axis is positive downward

See also:

https://developer.vuforia.com/resources/dev-guide/virtual-buttons

 

Log in or register to post comments