picking needed?

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.

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 regarding Intersection testing, and there are some alternate suggestions too. :slight_smile: