PDA

View Full Version : picking in 3d enviroment



RealityCheck
01-14-2006, 09:34 AM
i have 27 cubes arranged in 3x3x3.
i don't understand what code i need, to be able to get a cube to do something when clicked on.

PLEASE HELP

01-14-2006, 04:07 PM
This is a tutorial in a very popular technique:
http://www.lighthouse3d.com/opengl/picking/

Another approach renders objects of different colors into the back buffer, then reads the pixel at the mouse position back to determine the selection. This is the so-called "color id" approach.

Yet another approach uses geometrical line-segment intersections with world objects to determine the selection.

Cheers

:)