Welcome on the Daídalos project's official website
2008-08-24Mouse handling

It's been some weeks since the mouse has been implemented in Daídalos but i haven't told about it yet. So i've prepared an explanation for the people who want to know how this works.


Introduction:

In most recent FPS, the mouse allows us to explore the environment around us.
It has not always been that way and the firsts FPS didn't used the mouse (mostly because old FPS were not in real 3D). Daídalos draws its inspiration in old FPS, but it seems important to me to allow the use of the mouse, because it brings great comfort in this kind of game.


The principle:

The operating principle is simple, because it consists of transforming a translation movement (mouse) into a rotation movement (the player).

 

 

So in order to orientate the camera, we get the distance done by the mouse on the screen between two frames. If the x value is negative, then the mouse has been moved to the left and if the x value is positive, the mouse has been moved to the right. The same principle apply to the y value. After that in order to convert this data in an exploitable form, we affect a factor to this data. This factor is in fact what we modify when we change the mouse sensibility: we increase this factor to increase the sensibility.


The limits of the theory:

Unfortunately all is not so simple and it was almost too easy to be real.

Firstly we need to take into account that the mouse pointer is not glued to the window automatiquely. In most FPS we can move the mouse without problems and without being limited by the window. To do this the easier way is to replace the mouse pointer at the center of the window on each frame.

The second problem is not easy to find without actually encountering it. In theory when the user moves the mouse, the movement of the player is smooth and continues until the user stops its movement.
In reality some frames will count as a mouse movement, some will not. We have the illusion of a smooth movement but it's not the case actually.
With what we have seen before, the movement will appears as jerky and it will be very annoying. In order to avoid that the easier way is to have a memory effect of the movement. If a frame is during a mouse mouvement phase but the pointer is not modified, we use the movement value memorised instead.


That's all, i hope that my little explanation have helped you understanding how the mouse works in Daídalos, and probably in most games that uses a mouse.

Latest news

2011-02-25 - 2011.02.25 build release 2011-02-14 - 2011.02.14 build release
2011-02-11 - First release of the Alph... 2010-12-09 - New video
2010-11-20 - Opening of the forum 2010-11-19 - Project's progress
2010-09-26 - New technical video 2010-09-09 - Fist technical video
2010-09-02 - A new beginning 2010-03-15 - Screenshot of the first i...
2010-02-06 - 64Bits version available 2009-12-16 - Alpha 0.85 version release
2009-12-14 - New video 2009-10-28 - Alpha 0.8 version release
2009-10-24 - The end is near... 2009-10-12 - News and screenshots
2009-08-30 - Screenshots of the projec... 2009-07-20 - New version available
2009-07-12 - Illustration of the Occlu... 2009-07-10 - Performances comparison 0...
2009-06-25 - The fair of the particles 2009-05-04 - New optimizations
2009-03-10 - New version of Daí... 2009-03-07 - New screenshots for a new...
2009-02-19 - The project is out 2009-02-17 - Weapon handling - Second ...
2009-02-09 - Performances comparison 0... 2009-02-03 - New video
2009-01-27 - Weapon handling - First part 2009-01-06 - Back-face Culling
2008-11-12 - The project is out 2008-10-30 - New screenshots
2008-11-01 - Delay in the release date 2008-09-14 - Alpha demo 0.102
2008-09-13 - Release of the alpha version 2008-09-07 - New video
2008-09-04 - Alpha demo 2008-08-30 - The anisotropic filter
2008-08-29 - Additions and updates 2008-08-26 - New objects
2008-08-24 - Mouse handling 2008-08-23 - New screenshots
2008-08-21 - New objects 2008-08-20 - The gamma level
2008-08-19 - Antialiasing 2008-08-19 - Collisions - Part 2
2008-08-13 - The joys of the fog 2008-08-09 - First weapon!
2008-08-07 - The pillars 2008-08-06 - Collisions
2008-08-03 - Let there be light! 2008-08-01 - Level handling
2008-07-31 - First visual 2008-07-24 - Project presentation

» Advertising