Advertisement

another question about the mouse(new)

Started by September 18, 2005 10:50 AM
0 comments, last by eXXXile 19 years, 2 months ago
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:
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