another question about the mouse(new)
ok i succeed now when the client move his mouse to left\right it use
glRotatef
to move to camera...
but now there is another problom i want to put a QUAD
where the mouse is and it dont work so good .. i tried to do this:
glVertex3f(mouse_x+2,mouse_y+2,40);
glVertex3f(mouse_x,mouse_y+2,40);
glVertex3f(mouse_x,mouse_y+2,-40);
glVertex3f(mouse_x+2,mouse_y+2,-40);
but i have to move my mouse else i cant see it (i need to do a rotatef for seeing the square)
anyone got any idea how i fix this?
thx in advance
sounds reasonable since you draw the square on the z axis ( the axis that points toward you)
try drawing it on the x axis ( the axis with direction from left to right) like this:
assuming that you want the top-left edge of the quad to be where the mouse clicked
try drawing it on the x axis ( the axis with direction from left to right) like this:
glVertex3f(mouse_x, mouse_y+2, 40);glVertex3f(mouse_x+2,mouse_y+2, 40);glVertex3f(mouse_x+2,mouse_y, 40);glVertex3f(mouse_x, mouse_y, 40);
assuming that you want the top-left edge of the quad to be where the mouse clicked
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement