I have a scene, in which I am drawing few different objects - each one has the same vertices and each one is translated to proper place before being drawn.
While using libgdx (but I think that this question should be generic enough to work with other libraries), I try to do ray picking, casting ray and trying to find intersections of given ray with triangles, from meshes of each object. My problem is, that because they all share the same set of vertices, how should I find which one exactly was pointed by user?
As I have no experience in this, I was thinking about translating the vertices for each object and getting rid of glTranslate(x, y, z) called before each one, but in that situation I won't be able to use one copy of mesh to work with all objects.
May I ask for a few hints / links to articles how this should be done?