The Random Searchlight Searches Randomly!


To make a light cone look as if it's being projected onto the image from the viewer's point of view, give it a source Y coordinate towards the middle of the image, and a non-zero source Z coordinate to lift it 'away' from the surface. This cone's source has a Y coordinate of 50 pixels (around 20% down the image) to look like a helicopter searchlight coming from above, and a Z coordinate of 150 pixels away from  the image surface.

This page uses the JavaScript Math.random() method to generate random target coordinates, and the setTimeout() method to program step-by-step movement to each new position. When a position has been reached, it generates another set of random coordinates, and starts moving again.



Back to Menu