View Full Version : election for Tesselated Objects

10-24-2007, 01:07 AM
Objects rendered with gluTessVertex doesn't respond to the selection operation implemented with "SelectionBuffer". I have created the objects vertexes counter-clockwise and vice versa to see the effect whether I have made a mistake due to the sequential ordering, but either way performing clicking at the object doesn't yield the selection. What could I have done wrong ? Using the ray-casting could be more efficient way ?

Best Regards,

10-24-2007, 01:09 AM
sorry for the title "Selection for Tesselated Objects" :)

10-27-2007, 01:42 AM
Selection using ray intersections or OpenGL selection in complex environments requires some sort of bounding volume hierarchy to speed things up.

For OpenGL selection, you only want to render what could possibly intersect the thin beam of a pick frustum.

For ray intersections, you only want to test the ray against geometry somewhere near the ray.

For trivial scenes it doesn't much matter, but if you have a lot of objects, especially if they're made of many triangles, BV-trees can help enormously, with either method you choose.

10-27-2007, 08:18 AM
hello plasmonster,
thnxs for the answer

I have to admit that posting the general perspective of problem and expecting the elaborated solution is a bit silly.

Actually I'm using GLScene package to create primitive object/s. I need to create "I Shaped" steel profile, there are couple of ways to do it in it (constructing primitives and nesting them hierarcially or descent a new object which implement its own paint algorithm)
but I choosed to create it with TGLExtrusionSolid (if you are familiar with ) where diving into to the source code reveals
that it's implemented with "gluNewTess" tesselation method. For the object creation I use the 3 contours, in each one consist 4 set of nodes, first one defines the main body and other 2 contours defines extracting parts from main object. Althought, everything seems theoritically normal, trivial and supposed to select "I Shaped" profile on screen I couldn't figure out why the object selection doesn't work properly. Example code snippet or entry point will be appreciated.


10-27-2007, 09:28 AM
I'm not familiar with GLscene, but it sounds like you're into some tessellation and some picking.

Here's a good OpenGL picking tut:

And there are many other references, tutorials, and demos if you look through the menus at the top of the page. There's a GLUT tessellation demo called tess.c in there somewhere as I recall.

Ray-geometry intersection techniques can be found in lots of places, like the Graphics Gems Books and source code, Real-Time Collision Detection, and Computational Geometry in C, just to name a select few books. Huge subject but I hope that helps.

Ah, found it! Tess.c and many other goodies: