i know this subject has been talked to death, but, i just wanted to make sure my technique is correct.
i have a large 3d object, when a user clicks it, the point on the texture they click should be replaced with a red dot.
to achieve this, i'm going to:
- render the 3d object in a buffer with a texture, where each pixel is a unique colour.
- on click use readpixels to get the pixel colour
- update the original text with a red dot.
need a little help with the '???' bit.. i know the unique colour that was clicked, now i presume, I'd need to loop through the unique colour texture and find the x and y position of this colour..however, this would be slow if i had a 'big' texture, say, 512x512
is there a better way?