How to get a textures 2d on screen area

do you know what i mean? im going to make a cross word application, the crossword surface will be at an angle and i want the user to be able to select any square from the grid. so i need to be able to grab the resulting area of a texture after its been translated and rotated in order to find out if a touch event is inside it.

ill probably be using an OfTexture

May be ofCamera.screenToWorld() and ofCamera.worldToScreen() what you are looking for?

sounds perfect, how can i find a point on an object that has been transformed and rotated? for example in the textureScreenGrab example program

	glRotatef(counter, 0.1f, 0.03f, 0);
	float width = 200 + 100 * sin(counter/200.0f);
	float height = 200 + 100 * sin(counter/200.0f);;

could i do the same transform and rotate then find out the camera coordinates using the points that were used to draw it in the textures draw function?


if i understand correctly, your problem can be solved by using the inverse matrix of the transformation to find out if a point is inside. It is described here:


ive tested that, it looks very promising, it works if im rotating around the z axis as though it were a 2d game, but if i rotate around the x or y axis then it doesn’t work. is this technique only intended for 2d objects?