|
From: Dair G. <da...@re...> - 2004-06-23 21:54:18
|
Keith Wiley wrote: >Can I easily take a pixel coordinate and determine which 3D object is >under that pixel, in other words which 3D object (or actual triangle >or trimesh I suppose) is shallowest in the z-buffer at the pixel's >location? You want to use a pick object - see QuesaPick.h. If you're just interested in a single point use a window point pick, if you want to catch everything under a rectangle use a window rect. >I know Open-GL has routines for this sort of thing. Actually the routines in QD3D/Quesa are considerably more sophisticated: in OpenGL you tend to have to restort to tricks like rendering your scene through a 1x1 viewport with every object rendered in a unique colour. Under Quesa you can just submit to a picking loop, then read off your results at the end (the third type of pick is a world ray pick, which can be used for simple collision detection: i.e., shoot a ray out of the front of some object, and see what it hits). -dair ___________________________________________________ mailto:dair+refnum.com http://www.refnum.com/ |