We created a fallen tree trunk to use for decoration, but also as an obstacle.
We then created trees and rocks for filling the levels. This will put some more color into the scenes and make them look more interesting.
In the game, the arms of our character can be operated via the Kinect. In order to achieve this, we had to create an IK solver. The basic calculations of the IK were fairly simple:
Knowing the length of each edge, we could calculate the angles (alpha and beta) using the cosine rule. From there, we recalculated the positions of both the elbow and the hand using alpha and beta respectively.
Then we had to rotate the three body parts, so the mesh would align beautifully with the direction of the bones. This turned out to be a bit more tricky, since each bone of the mesh already has a default rotation.
Each bone looks at its parent bone along the x-axis. So the solution was to use the default “LookAt()” function from Unity, then rotate 90 degrees around its local y-axis . The reason behind the extra rotation is because the “LookAt()” function uses the z-axis as its forward, meaning the bone would look at its parent along the z-axis. By rotating 90 degrees around the y-axis, the bone will once again look at its parent with the x-axis, but this time with the correct orientation.