OpenGL Picking -- GLUT

Started by
6 comments, last by OpenGL_Guru 20 years, 5 months ago
hi all. i am trying to make a picking class for all my opengl applications called(cleverly) PICK. i have a couple of primers and the openGL game programming book, but the code on this subject or even the mere mention of the topic is scarce. i dont want to have just one way of picking, rather multiple ways if you will using the mouse function associated with GLUT. since my OGL apps are portable i need something that is good for Windows and Linux so i am not looking for something specific to Windows. some of the things i want to be able to is simple things like changing the color, size, transparency maybe through a glut menu type set up and to more advanced things like moving the object around or at least rotating it with the mouse at real time. if anyone would please give me some links to help me on my way or if you have some recommendations of books that go through picking in some detail along with some code(in other words that just dont talk about it and go onto the next subject which i hate) then please tell me about it. thanks in advance!
heh
Advertisement
OpenGL Programming Guide (the Red Book), Chapter 13.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
thanks a lot... looks like some good code, but i would really rather not code using aux functions, rather mouse functions in glut..i.e.. GLUT_UP, GLUT_DOWN etc etc. none of my other code uses AUX functions, im trying to be portable yet clean in my code. i will be using this code though no doubt, thanks for the tip.. aux is old and not supported anymore however.
heh
Who said anything about AUX functions ?

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
the code you refer to in chapter 13(which actually refers to chapter 12) using AUX.h for the mouse functions and the like, thats all i meant.
heh
quote:Original post by OpenGL_Guru
the code you refer to in chapter 13(which actually refers to chapter 12) using AUX.h for the mouse functions and the like, thats all i meant.


The OpenGL Red Book is entirely done using GLUT. What the hell are you talking about.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
unless you are looking at a new version of the OpenGL red book the section(s) discussing picking use the auxilary functions and libraries. maybe there is a new version out that uses GLUT i dunno. maybe someone can clarify this? thanks.
heh
I believe you''re looking in the first release of the Red Book. Looking in an online copy of that book, it uses AUX instead of GLUT, and the chapter on picking and selection is 12 as you said, which makes me believe that is the one you have. I strongly suggest you get a later version, like 1.1 or 1.2, which, by the way, are written using GLUT instead of AUX.

This topic is closed to new replies.

Advertisement