Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Picking



> Does anyone have any idea how to extract useful information about of an
> OpenGL picking call? It seems that the data returned while in GL_SELECT
> mode is only very rudimentary. It returns in the Pick Buffer only the
> min/max z coords of the polygon that was picked and the user ID value.

I don't think OpenGL gives you this directly.

> Is there any way to get accurate pick information such as the *real* z
> coordinate of the pick, or the world x,y,z coordinates of the pick? How
> about the UV value at the pick point?

You could use OpenGL picking to narrow down which polygon was picked, then
project a line (from the selected screen coordinates) through the
(transformed) polygon to compute the information you need.

Of course, if you've done that much then with a little more effort you can
probably dispense with OpenGL's picking mechanism altogether. I found it
useful for my uDevGames entry but it really seems geared to finding which
polygon(s) were clicked on and nothing else.

Glancing at my Red Book, you may also find gluUnProject and/or gluUnProject4
helpful. I haven't used them myself so I can't comment.

Good luck,
Matt Diamond
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.