Thursday, December 29, 2016

Buggy



Brief Overview
This is an engine application specifically designed to showcase collision detection algorithms. I started by working on Look-At algorithm that helps the buggy and it's gun to point towards the target and fire. Then proceeded to implement Turn-To algorithm for the buggy to move forward and backward so that it faces the same direction as the buggy's gun. Performed Ray to Sphere intersection to test against all targets in the world. And if there is any collision with the target, the crosshair is set to point the target by using "Orient in the direction the object is moving " algorithm, and finally once the crosshair has shot the target, I attempt to use Kill() function in update to removes the child targets, and perform the spinning of the target. This application also supports the ability where the buggy moves with the crosshair around the terrain using Line to Triangle Intersection algorithm.

lookAt Matrix/Camera
The above algorithm is used to construct view matrix where a camera is located at the eye position and looking at (or rotating to) the target point. The eye position and target are defined in world space. Camera's lookAt transformation consists of 2 transformations - translating the whole scene inversely from the eye position to the origin, and then rotating the scene with reverse orientation, so the camera is positioned at the origin and facing to the z_axis.

Camera Orientation

No comments:

Post a Comment