I have a few buttons that I display on screen that are rotated around in 3d a bit using the transform methods like ofRotateY. I want to detect when the user clicks on them.
I figure I need to get the four corners of the button after they have projected into screen space, but I am not sure how to do that. I saw this post: hit-testing that mentions using ofWorldToScreen, that seems cool, but that method doesn’t to be part of openframeworks (I am using v0.8.3)
Whats the best / simplest / elegant way to solve this? I should mention that I am not using an ofCamera because the view is relatively static
In way of an example I want the Red and White circles to be drawn at the same location in the code below
ofVec2f worldPoint(300, 300);
ofVec2f screenPoint;
ofPushMatrix();
ofRotateY(70);
ofSetHexColor(0xFF0000); //Red
ofEllipse(worldPoint, 100, 100);
//TODO: get worldPoint final location on screen
ofPopMatrix();
ofSetHexColor(0xFFFFFF); //White
ofEllipse(screenPoint, 50, 50);