PDA

View Full Version : PIVOTING--HELP! code included



Andrewinator
11-17-2003, 02:25 PM
Here is my passive mouse function:



void cbPassiveMotion(int x, int y)
{
if (x < cursorx)
{
player.Anglex -= (cursorx-x)/3;
cursorx = x;
}
if (x > cursorx)
{
player.Anglex += (x-cursorx)/3;
cursorx = x;
}
if (y < cursory)
{
player.Angley -= (cursory-y)/3;
cursory = y;
}
if (y > cursory)
{
player.Angley += (y-cursory)/3;
cursory = y;
}
}

And in my idle function I have:

mapposx += speed * cos((3.1415926/180.0) * (mapAnglex));
mapposy += speed * sin((3.1415926/180.0) * (mapAngley));

What I want is my pivitol point to follow me around (this is in 3D), but what I have shown you does not work at all. PLEASE HELP AS SOON AS POSSIBLE!!!