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



On Wednesday, December 25, 2002, at 08:27 AM, Brian Greenstone wrote:

on 12/25/02 10:17 AM, Dario Accornero at email@hidden wrote:

I'm about to implement the same thing that Brian is doing, and, yes,
any sample code would definitely help...

Well, I've decided that there's just no way to do real picking in OpenGL, so
I'm currently writing my own picking functions to do ray->triangle
intersection tests.

What's wrong with the glReadPixels second pass?

My own hard-won experience on this (let's see, so far we've used GL_SELECT (too inaccurate), then glReadPixels (too convoluted a code path, inconsistent results on early 10.x), then ray casting (too slow for big data, incompatible with gpu-side procedural geometry & deformations), then a fancy cyclic-coord-descent + octree scheme (fast, but convoluted, and no gpu-side stuff), and finally back to glReadPixels)...

Use GL_SELECT for drag-selection. Nothing else will be as fast for area selection.
Use glReadPixels for picking. We had to do a significant restructuring of our render pipeline to make this work cleanly, but having done it, it works better and faster than anything else.

It took 2+ years to get right, but finally drag-selection, dragging, and picking all work perfectly, on all geometry, all the time, and are _fast_. Nightmare getting there. Save yourself the trial-and-error.

I'm on a plane at the moment, but I'll post some code later this week.

Dan
_______________________________________________
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.

References: 
 >Re: Picking (From: Brian Greenstone <email@hidden>)



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.