> After having another attempt at picking i noticed something strange in
> my applet. When you move the spheres with the arrow keys ( y
> translation) and (x translation) or use the mouse zoom (z translation)
> you are still able to click on the spheres and the crosshair will appear
> as a test.
> However, when you use the rotation and camera rotation feature the
> program appears to lose track of the objects.
This sounds like incorrect matrix management. Performing picking
in 3D is non-trivial, which is why I prefer to (a) do all of the
requisite linear algebra at the application level, to avoid
misuses of the underlying graphics library, and (b) write it once
so I can forget about how it's implemented. Take a look at gleem:
http://www.media.mit.edu/~kbrussel/gleem/
It is likely that you'll at least be able to borrow some of the
picking routines if not use the widgets to solve your problem.
It's got a nice ExaminerViewer class (UI and name borrowed from
Open Inventor) which allows rotating and dollying using the mouse
while still maintaining proper selection of the widgets.
|