PDA

View Full Version : Selecting an Object



Rajiv Mishra
08-06-2001, 11:26 PM
Hello friend,
I have developed an appliction which display two 3D-objects in a same window,now I wants to select one object by a mouse,so that I can change the properties of that object and other remains same.
please provide some code in support of your answer.

With Thanks

chennes
08-07-2001, 06:20 AM
http://nehe.gamedev.net/tutorials/lesson33.asp

Rajiv Mishra
08-09-2001, 03:13 AM
But in this code selection made on the TGA image but in my window objects are made or creared by the use of OpenGL itself.

chennes
08-09-2001, 03:53 AM
The selection done in this example will work for anything that you draw in OpenGL (with the exception of bitmaps, which will only hit near their initial raster point). In this tutorial, what is being hit is not the TGA - it's the quad that the TGA is mapped onto. After the call to gluPickMatrix(...), draw your scene, giving each object a name before you draw it. Proceed precisely as in the tutorial.

Chris