how to draw a polygon by mouse with openGL in c++
+4
A:
Maybe go to class, pay attention, and learn what the teacher says? Or look at the NeHe tutorials, which you can find through five minutes of using the almighty Google?
mmr
2008-12-12 17:44:15
+8
A:
Start by conditioning the mouse to recognize the shape of a polygon and be able to complete one it sees on a computer screen. You can use operant conditioning (by rewarding the mouse with a food pellet) to train it to an acceptable level of proficiency.
Marc Charbonneau
2008-12-12 17:55:42
Note to self: do not eat cereal while reading SO answers. :)
Jim Buck
2008-12-12 18:04:51
lol I was gonna downvote before a I realized this was a homework question, +1
hasen j
2009-02-04 02:25:49
+3
A:
Assuming this is homework, and that you want to try to figure this out for yourself before looking at someone else's solution, take a moment to think about:
- How do you know when the user push a button?
- What are the mouse coordinates at that time?
- How do you translate the mouse coordinates to the world coordinates of your GL-model?
- How do you figure out which vertex to move? (or add)
- How do you move the vertex?
- How do you redraw?
- What is the connection between model and view?
Rolf Rander
2008-12-19 12:40:39