• Advertisement
Sign in to follow this  

picking a mesh

This topic is 4680 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, i have several meshes in my scene which i want to pick with the mousecursor. what is an easy and fast way to do this? the scene is rotatable and scaleable. thanks!

Share this post


Link to post
Share on other sites
Advertisement
ok, i figured out its the GL_SELECT render mode i have to render the meshes in.
this is really cool and i got it to work already.

strange thing is, that when i build my solution in debug mode everything works fine, but in release mode i got strange results.

seems as if the selection buffer gets wrong values.

GLuint selectBuffer[128];
glSelectBuffer(128,selectBuffer);
...

then to check if i hit an object:

if (selectBuffer[3] == it) // i only need to check for the first object


in release mode this sometimes gives me true although there was no hit.

Share this post


Link to post
Share on other sites
Might I suggest you zero the memory of your array before sending it off to be checked for selection? You can avoid random memory values from showing up as your selected items if you simply set the memory to something you don't use (0 for instance).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement