ThatSnail

3D FPS

Jun 14th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. double cdx,cdy;
  2. cdx=camera.xto-camera.x;
  3. cdy=camera.yto-camera.y;
  4.  
  5. double dir;
  6. dir=atan2(cdy,cdx);
  7. dir-=dx/200;
  8.  
  9. double r;
  10. r=sqrt(cdx*cdx+cdy*cdy);
  11. camera.xto=r*cos(dir);
  12. camera.yto=r*sin(dir);
  13. camera.zto+=dy/200;
  14.  
  15. SDL_WarpMouse(SCREEN_WIDTH/2,SCREEN_HEIGHT/2);
Advertisement
Add Comment
Please, Sign In to add comment