View Full Version : Please help me with this (more on point selection)

08-06-2003, 09:09 AM
I would really appreciate it if someone could give me an example of code or point me to a tutorial for this.
Imagine a cube defined with glVertex commands.
Then the point of the cube are drawn again. I want the user to be able to select/highligh a point if he click on or close to it.
Please help... :-(

08-06-2003, 03:39 PM
go to gametutorials.com and look around, there; there is a tutorial showing how to make selections work in GL.
(its a very easy one)

08-06-2003, 04:06 PM
All I can find there is selecting object, which I know how to do... what I can't do is having an object and letting the user select it's components... :-( the exmaple on that site uses selection buffer, which is not what is needed in this case...

08-06-2003, 04:14 PM
a As has already been suggested, you need to look for references on Ray casting (perhaps you could try Google?). To do vert/ray intersections you probably want to look for sphere/ray intersection algorithms, or just triangle/ray intersections. You can probably find what you need here (http://www.realtimerendering.com/int/#IV24)

b This is not an Opengl question, this is a 3D math question. Perhaps you should look for a mathematics forum and/or web sites.

c Please stop posting beginner questions in the Advanced Coding forums.

08-06-2003, 04:24 PM
rgps, sorry, didn't realize it was a beginner question...