Sign in to follow this  
Wizumwalt

how to do picking w/ vertex arrays

Recommended Posts

Wizumwalt    161
Hey all, I have a wire frame mesh and I'm trying to have each element of my mesh highlighted by hovering the mouse over a single triangle of the mesh. I think my problem is that I'm using vertex arrays. I set the vertex arrays up just as soon as my application reads in an input file, parses the coord values, and loads them into vertex arrays. As I understand it, I need to call glLoadName(int) for each triangle while on the MODELVIEW matrix during render mode SELECT so that I can process the hits. But since all my triangles are stored in vertex arrays, how can I call glLoadName() before each draw command for a single triangle in my mesh? I can only set 1 name per vertex array. I really need the performace I get out of vertex arrays, but ... I'm wondering if there is a way to select maybe a group of elements, then show that cropped group of triangles and call glLoadName on each element there, but again, it seems like it would require my picking to work in order to insersect the selected elements. Any other ideas, help, advice much appreciated.

Share this post


Link to post
Share on other sites
jyk    2094
You might see if you can get this moved to a different forum, such as graphics programming or OpenGL; you might get better responses there, as this really isn't a 'generel programming' question.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this