PDA

View Full Version : Rotating Cube - Find selected Part



longyearbyen
11-14-2007, 07:37 AM
I got an arbitrarily rotating Cube that displays random images.
One image on each part of 6.
The user selects with the mouse one of the images.
How can I find out which part of the cube (top,bottom,...)
is selected.
Maybe someone can point me in the right direction.

Kumar K
11-14-2007, 08:14 AM
The easiest way you need to do is draw six different polygons.
And implement openGL based selection methods for picking.

longyearbyen
11-14-2007, 08:35 AM
Thanks for your answer.
I admit I dont now much about openGl.
I found NeHe Lesson 32 is about selection.
Looks pretty complicated compared to standard gui programming.

ZbuffeR
11-14-2007, 08:51 AM
Standard gui programming don't do hardware-accelerated texture mapped cubes :)

If you are uncomfortable with low level programming, try to find a framework which already implements the features you want.

longyearbyen
11-14-2007, 02:35 PM
Or maybe as an answer:

glSelectBuffer(BUFSIZE,pointer);
glRenderMode(GL_SELECT);
glInitNames();
glPushName(0);
glLoadName(0);

Those are the methods to look at.