From: Christopher K. S. J. <cs...@qu...> - 2001-02-18 16:26:14
|
Patrick AS Sinclair wrote: > > What's the best way to do this? > Normally picking is done as a separate traversal, so you'd need to copy the code that walks the geometry tree, transforming the point as you go. There isn't code to do that right now, since picking is done 2d using OpenGL's native picking support. For an overview of how it might work, were it to be implemented, check out the Performer or Inventor documentation at the SGI site. I'd kinda like to see something along theses lines, but nothing is set in stone: 1) add code to the core-side so the geometry primitves spit out triangles (meshes? strips? whatever) instead of calling over to the opengl side. keeping the geometry over in core side means a simpler, easier to optimize opengl layer, it also means... 2) using (1), you can add generic code to do view frustum culling, since currently the culling code would need to reproduce much of the code over in the opengl layer, for example in order to do extrusions. (right now, extrusions just aren't culled, which means they render slower sometimes but doesn't cause any other harm) 3) using (1), we can then add generic code to do ray-based (or point-based) picking. right now, to do picking against extrustions, you'd have to reproduce all the extrustion rendering code yet again. unlike culling, picking has to work for everything the first time, you can't just do the easy bits and leave the rest for later. 4) using (1,3), add terrain following and avatar collision code. Note that 3d-point-based picking is fairly easy, but true object-object collision detection doesn't fit very well into the above framework, it's really a totally separate thing, you'd probably need to glom on something like vcollide (there are some articles about this is the various VRML conference proceedings, if anybody is interested) Sorry it took so long, my life has been very, hmmm, "interesting" lately :-) -cks - |