View Full Version : Selection Mode, selecting front poly only
06-04-2005, 07:05 AM
Anyone know how to pick only the front most poly using selection mode?
I know there's got to be an easy answer, but it's slipping me now..
06-04-2005, 04:35 PM
When you finish selection the glRenderMode call returns the number of hits.
Each hit record includes the minimum & maximum depth, so look at the values written to your selection buffer & compare to get the nearest, the granularity will depend on the names you have, the bufefr includes the name stack.
So each hit gives:
The usefulness of the depth information depends on how you've grouped your geometry and names. It cannot be perfect, but it will help you narrow the field and allow further refinement.
06-04-2005, 09:32 PM
I never quite did get how those min/max depth values worked..
If I get you right, depth_min_of_primitives is the distance of the nearest primitive to the viewpoint that recieved a selection hit?
So I find each "shape" (I use the winged-edge data structure by the way) in the name stack,
and compare the distance from it to the viewpoint with depth_min_of_primitives,
The closest one is the one I select..
Is that about right?
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.