Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Picking a point using OpenGl
Forum Updated to NodeBB v4.3 + New Features

Picking a point using OpenGl

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lola
    wrote on last edited by
    #1

    Hi, I have an application that draws a triangular mesh using OpenGL, and I need to be able to pick up (select) a vertex of the mesh with a mouse click, I mean, I need to know which vertex was clicked.

    Does anyone knows how to do this????
    Thanks

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cpscotti
      wrote on last edited by
      #2

      OpenGL stuff are draw-only and they don't "reside" nowhere.
      You should have your own "model" of whatever you are drawing and compare a click event to that data instead of the actual drawing.

      cpscotti.com/blog/ - Used when I need to kill some time at work :D

      1 Reply Last reply
      0
      • M Offline
        M Offline
        minimoog77
        wrote on last edited by
        #3

        You will need to do some raycasting and detect if the vertex is near the ray.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved