I have picking working and if I click an object, chooseNum below is #0, if I click in empty space I got no chooseNum at all, which is what I would expect. Now how do I get form a 0 to an acutal object to act upon? Here is the bottom half of my pick code:
hits = GL11.glRenderMode(GL11.GL_RENDER);
String chooseNum = "";
if(hits > 0) {
int choose = buffer[3];
int depth = buffer[1];
for (int i = 1; i < hits; i++) {
// If This Object Is Closer To Us Than The One We Have Selected
if (buffer[i * 4 + 1] < (int)depth) {
choose = buffer[i * 4 + 3];
depth = buffer[i * 4 + 1];
}
}
chooseNum = "#" + choose;
//testMessage = "[HIT] choose: " + choose;
// now print the chooseNum test message to the screen
}
Thanks
M
