Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. OpenGL slection/picking(mouse based) HEELP?

OpenGL slection/picking(mouse based) HEELP?

Scheduled Pinned Locked Moved Graphics
graphicscsharpgame-devhelpquestion
3 Posts 3 Posters 3 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.
  • R Offline
    R Offline
    Raza5680
    wrote on last edited by
    #1

    I am currently working on a drawing application using openGL and C#..........having a nightmare trying to grasp concept of selection/picking... My application will be drawing 2D(later 3D) objects...the user will be able to select any edge of a polygon and move it around/modify it.. I have seen few tutorials but they were not really useful..i am still confused about how the retreived information in selection mode(Hits records) will help in performing above mentioned editing functions kindly help please suggest links/tutorials (better if in C#) thanks

    X 1 Reply Last reply
    0
    • R Raza5680

      I am currently working on a drawing application using openGL and C#..........having a nightmare trying to grasp concept of selection/picking... My application will be drawing 2D(later 3D) objects...the user will be able to select any edge of a polygon and move it around/modify it.. I have seen few tutorials but they were not really useful..i am still confused about how the retreived information in selection mode(Hits records) will help in performing above mentioned editing functions kindly help please suggest links/tutorials (better if in C#) thanks

      X Offline
      X Offline
      XTAL256
      wrote on last edited by
      #2

      Have you tried http://nehe.gamedev.net. It's in C++ but the concept is the same for selection. Here[^] is the tutorial for selection/picking. It mentions something about gluPickMatrix() so i don't know if that's the same in C#. Hope that helps.

      -------------------------------- Customer in computer shop: "Can you copy the Internet onto this disk for me?"

      T 1 Reply Last reply
      0
      • X XTAL256

        Have you tried http://nehe.gamedev.net. It's in C++ but the concept is the same for selection. Here[^] is the tutorial for selection/picking. It mentions something about gluPickMatrix() so i don't know if that's the same in C#. Hope that helps.

        -------------------------------- Customer in computer shop: "Can you copy the Internet onto this disk for me?"

        T Offline
        T Offline
        tomitron
        wrote on last edited by
        #3

        The gamedev tutorial is definatly a good place o start. The basic concept is as follows. You have an object (say a box) give the box a bounding box or sphere. Pass the center vertex position of the box through the projection pipeline (i.e. project it onto the screen, there are opengl matrices that can do this). This will give you the coords of the object in 2d screen space. You also have to find the screen space size of your bounding area (same kind of method) once you have these you can test the mouse coords against the screen space bounding area. That isn't the best explination ever but it's somthing to start on. I'll see if I can dig out the code to project into screen coords

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups