How should I go about adding camera collision to a terrain in three.js.
The terrain is from 'mrdoob's three.js' examples and is randomly generated and I am currently converting it to height map.
I am thinking of implementing the collision as follows:
- Create a 'box' object around the camera
- If the box object is not touching the terrain, move the camera down.
- If the box object IS touching the terrain, keep the Y axis of the camera.
How should I go about doing this?