Roll Camera, Action!
08 Jan 2016Besides working on the simulation & rendering system for the map editor this week, I finally added a properly controllable camera model to the codebase.
Technobabble begins
The camera has some physical properties, such as linear and angular velocity/acceleration. The simulation handles the integration of the properties over time and the renderer draws the current state of the camera.
The camera view model itself is a simple one, but nicely suitable for isometric game purposes, I think.
In fact, all that is needed for the orbital camera model shown above can be condensed into these components:
- Target, vector3 - the point in space where the camera points at.
- Distance, scalar - the distance from the target point to camera origin.
- Yaw/pitch, scalars - the Euler-angles representing rotation of the camera, around our target point.
- FOV, scalar - the field-of-view of the camera.
- Aspect-ratio, scalar - camera view width/height ratio.
- Z-plane near/far, scalars - the camera view near and far plane distances.
Controlling the described parameters, it's rather easy to make the camera follow physically plausible trajectories. The user can manipulate the camera with both keyboard and mouse - the UI controls are still to be polished into their final shape, but the scene is already quite easy to navigate about.
Finally, the camera model is able to convert itself into view- and projection-matrices directly compatible with further processing done by the graphics pipeline.
Technobabble ends
Next up in the dev blog: The Birth and Death of Voxely Objects - stay tuned!