c++ - mouse movement opengl -


i creating pool game written in c++ using plain opengl (no external tools), can use glut. have drawn pool cue want follow mouse cursor not sure how this.

i know how use keyboard input move things e.g camera position or draw object m not sure how move object using mouse input.

this cue trying move via mouse input:

void cue () {   glbegin;   gltranslatef(-10,5,0);    glrotatef(90,0,1,0);    glutsolidcone(0.25, 15, 20, 20);   glend(); } 

glut has few mouse callback function
mouse callback
motion callback

you use callback figure out movement of mouse, rest pure math.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -