mouse mickeys
well i dunno if mickeys is the real technical term but thats
what its called in allegro... anyway on to the question
how in winapi/directx/opengl/etc/etc/etc do i get mouse mickeys
(mouse mickeys are how far the mouse moved since the last time u checked even if the movement would put it off the screen)
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net
if im understanding you correctly then all you need to do is
psuedo code:
float MouseX, MouseY, CurrentX, CurrentY;
if(CurrentX != MouseX)
{
findDistance(CurrentX, MouseX);
}
if(CurrentY != MouseY)
{
findDistance(CurrentY, MouseY);
}
and everytime they stop moving the mouse replace mouseX with currentX ect
psuedo code:
float MouseX, MouseY, CurrentX, CurrentY;
if(CurrentX != MouseX)
{
findDistance(CurrentX, MouseX);
}
if(CurrentY != MouseY)
{
findDistance(CurrentY, MouseY);
}
and everytime they stop moving the mouse replace mouseX with currentX ect
Use what Prod basically showed you, but remember to move the cursor back to the center every time.
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
ahh move it to the center every frame i get it 
you are a genius

you are a genius
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net
Ok, we got mickeys and we got FERNANDO-BRASIL screaming of Gimbal lock..
I''m thinking Gimbal lock is the weird thing where my rotation scheme is setup like this (incorrect newby way :-D):
//(neat mickey grabber)
GetCursorPos(&movementMousePosition);
SetCursorPos(320,200);
camera->angle.x += (float)(movementMousePosition.y-200)/5.0f;
camera->angle.y += (float)(movementMousePosition.x-320)/5.0f;
//(Gimbal lock causer? is that even the right term?)
ogl.oglRotate (camera->angle);
OpenGL::oglRotate (TEVECTOR3D rot)
{
glRotatef(-rot.y, 0.0f, 1.0f, 0.0f);
glRotatef(-rot.x, 1.0f, 0.0f, 0.0f);
glRotatef(-rot.z, 0.0f, 0.0f, 1.0f);
}
///////
At first, I move my mouse up and down, and the screen rotates up and down. After spinning around a whole bunch, pretty soon moving my mouse up and down makes the screen rotate left and right, not good! "Ack! I need quaternions!!!" screams the newb.
Ok, yes, I''m woggling around in 3d space not confined to a 2D plane like in a FPS, and, oh sure, I have no knowledge whatsoever of what my actual matrices are looking like. Isn''t there an easy way to just rotate myself up when I move the mouse up, even if I happen to be looking sideways and it should actually be adding to the x rotation? How do I know? Matrix multiplication? Is that where this is going? Am I doomed to manually manipulating my matrix? Post links to helpful sites if this is the case :-)
I''m thinking Gimbal lock is the weird thing where my rotation scheme is setup like this (incorrect newby way :-D):
//(neat mickey grabber)
GetCursorPos(&movementMousePosition);
SetCursorPos(320,200);
camera->angle.x += (float)(movementMousePosition.y-200)/5.0f;
camera->angle.y += (float)(movementMousePosition.x-320)/5.0f;
//(Gimbal lock causer? is that even the right term?)
ogl.oglRotate (camera->angle);
OpenGL::oglRotate (TEVECTOR3D rot)
{
glRotatef(-rot.y, 0.0f, 1.0f, 0.0f);
glRotatef(-rot.x, 1.0f, 0.0f, 0.0f);
glRotatef(-rot.z, 0.0f, 0.0f, 1.0f);
}
///////
At first, I move my mouse up and down, and the screen rotates up and down. After spinning around a whole bunch, pretty soon moving my mouse up and down makes the screen rotate left and right, not good! "Ack! I need quaternions!!!" screams the newb.
Ok, yes, I''m woggling around in 3d space not confined to a 2D plane like in a FPS, and, oh sure, I have no knowledge whatsoever of what my actual matrices are looking like. Isn''t there an easy way to just rotate myself up when I move the mouse up, even if I happen to be looking sideways and it should actually be adding to the x rotation? How do I know? Matrix multiplication? Is that where this is going? Am I doomed to manually manipulating my matrix? Post links to helpful sites if this is the case :-)
Vote to unban David Ho!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement