Draw with a mouse in openGL

How do you draw a polygon with a mouse with openGL in C ++?

+1


source to share


3 answers


Start by preparing your mouse to recognize the polygon shape and complete it on your computer screen. You can use operant conditioning (by rewarding the mouse with a food pill) to train it to an acceptable level of proficiency.



+12


source


Assuming this is homework and that you want to try and figure it out for yourself, before looking at another solution, consider:



  • How do you know when a user clicks a button?
  • What are the coordinates of the mouse at this time?
  • How do you translate mouse coordinates to world coordinates of your GL model?
  • How do you determine which top to move? (or add)
  • How do you move the top?
  • How do you redraw?
  • What is the relationship between model and view?
+5


source


Maybe go to class, pay attention and find out what the teacher is saying? Or check out the NeHe tutorials you can find after five minutes of using the almighty Google?

+4


source







All Articles