I have some picking code done by setting rendermode to select. It works in that my hit count = 1 (instead of 0) when I click on a 3d object. What doesnt work is...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| String chooseNum = ""; if(hits > 0) { int choose = buffer[3]; int depth = buffer[1]; for (int i = 1; i < hits; i++) { if (buffer[i * 4 + 1] < (int)depth) { choose = buffer[i * 4 + 3]; depth = buffer[i * 4 + 1]; } } chooseNum = "#" + choose; } |
choose in the above code is always 0 regardles of how many items are on the screen. Any thoughts?