PDA

View Full Version : picking needed?



ken84shin
12-14-2009, 12:27 AM
Hi,

Currently Im working on opengl, just started learning this.
I have this problem now.
Take for example, I'v loaded a ball object from an object file.
After loading this object, I use some functions and the mouse dragged event to draw a stroke infront of the ball.(like a knife tool, cutting the ball into halves)
Now, I would like to shade the left side of the ball blue and the right side of the ball green.

The problem is that when I draw the stroke, how to I detect the faces that are actually under the stroke?are there sample codes around?

I'v tried other forums, but the solutions are too in-depth for me as a beginner.

Hope I can get some help here.
Thanks in advance.

scratt
12-14-2009, 03:53 AM
I would advise forgetting traditional OpenGL picking, and using Ray Intersection testing using something like the ColDet library which you can find on Sourceforge.

I reference some stuff in this post (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=258304&Searchpa ge=1&Main=50169&Words=coldet&Search=true#Post25830 4) regarding Intersection testing, and there are some alternate suggestions too. :)