Surely in the films saw the security camera moves there and there. Here on the site you need to make a camera like that. Everything would be simple, but I want to make it turn behind the cursor. Where the mouse - there and the camera. How can this be implemented? If the site is not on a flash, can it be done on a flash? Or maybe someone knows a way to do this on js?

PS: The camera, of course, should not shoot anything))

    2 answers 2

    Heh .. With this question you reminded me of the old days. )) Then, such a chip was implemented simply with the help of JS: virtually we divide the visible area into several parts and, depending on which area the cursor is on, the corresponding picture was shown (then it was the eye). If the cursor is at the bottom of the screen, then the picture where the eye looks down, if at the top, then the picture where the eye looks up, etc.

    I don't seem to indulge in this today, but if such an example fits, then why not? ))

    • Thanks, good implementation, only a lot of frames will have to be saved, consider almost every pixel to update the picture. And in the future will be loaded for a long time. - iproger
    • @mctrane, yes well, quit)) Now such scripts are used on sites that such will be just a "dwarf" in comparison with them. Upload images every time is not necessary. They are loaded together, and only certain is shown. - Deonis

    I would track the position of the mouse in the viewport ( mouse position ), and depending on how the camera is released (a set of pictures or one universal or something else), I would apply math and turn / change it.