Log in or register to post comments

Get virtual button area in screen coordinates

February 16, 2017 - 8:23am #1

Hi,

 

I need to display some text under a virtual button (on the phone screen, I'm making an Android app).

 

Basically, my code looks like:

VirtualButtonResult buttonResult = imageTargetResult.getVirtualButtonResult(0);
VirtualButton button = buttonResult.getVirtualButton();
Rectangle buttonArea = (Rectangle)button.getArea();

 

However, I have no idea how to convert the coordinates given by button.getArea(), which are in target coordinates, into screen coordinates.

 

I read about the projectPoint() method but:

  • What is the pose matrix? How do I get it?
  • projectPoint() takes a Vec3F (X, Y, and Z) but getArea() only provides X and Y coordinates, what am I supposed to put for the Z coordinate?

 

Thank you!

Log in or register to post comments