Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


how to pick mesh


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 OXLE   Members   -  Reputation: 104

Like
0Likes
Like

Posted 10 December 2012 - 09:51 AM

I use OpenGL show OpenMesh in a window and I want to use mouse to select some vertices,edges or faces of mesh and I only want to select vertex,edge,face which I can see in viewport how can I do that only using OpenGL. the mesh may have more than 10000 vertices

Sponsor:

#2 larspensjo   Members   -  Reputation: 1557

Like
0Likes
Like

Posted 11 December 2012 - 06:04 AM

I think you need to use color picking. That is, you draw your objects in a unique color for each object. Don't show the result, but read out the color at the screen coordinate of the mouse. That color will then identify what object is behind the mouse.

You will probably need three different modes, for vertices edges and faces. For vertices, it may be an idea to draw small quads instead of dots, making it easier to hit them with the mouse. For edges, you can draw wide lines.

Do you want continuous detection of the object behind the mouse, or only when the user clicks with the mouse? Continuous detection can lead to performance problems.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS