COMPUTER GRAPHICS

INVERSE KINEMATICS
IMPLEMENTATION IN UNITY (c#)

As part of my coursework for Technical Animation (CMU 15-664), I tried my hand at implementing Inverse Kinematics (IK) in Unity. I attempted two implementations of IK using the Jacobian Transpose and Jacobian Pseudoinverse methods respectively. 

The demo above in Unity shows a real-time comparison of the two implementations. The bones following the red spheres demonstrate the Transpose method, while the bones following the blue spheres demonstrate the pseudo-inverse method.

Each sphere influences a set of 3 joints, and can be moved around in 3D space by a cursor.

  • The transpose is computed using the Analytical method.

  • Clamped the rotations to within 360 degrees.

  • Clamped the motion if the target position is far from the end effector.

  • Added a small identity matrix to the original to make it invertible.

  • Used Mathnet.Numerics plugin for Unity to perform Matrix operations

 
 
'EXODUS GAME'TERRAIN LOCOMOTION

As part of my work with Burnt Onion Studio at Carnegie Mellon ETC, I built a custom character locomotion tool in Unity using C#.

The requirement was to have the central character (a hexapod walking fortress) move around on an uneven terrain multiple elevation levels with foot placement. I looked into IK Pass feature in Unity, which seems to work only for traditional humaniod avatars. I procedurally animates the legs based on points along curves, and used raycasting to determine the ground position under the feet and modify the feet trajectories acccordingly. The solution is scalable to any number of legs. I used Unity's Custom IK for the inverse kinematics of the moving limbs.

[above] Iterations...

[above] Iterations...

[above] Some tests with the hexapod in the game.

 
Cloth Simulation
in Unity (C#)

As part of my coursework for Technical Animation (CMU 15-664), I simulated cloth behavior from scratch in Unity using C#.

  • I used the Verlet Integration scheme  as described in the paper, ‘Advanced Character Physics’ by Thomas Jakobsen.

  • Used a procedurally generated mesh to act as the cloth. The motion is achieved by treating the vertices as particles, establishing constraints between them and satisfying these constraints in a time-stepping fashion.

  • Read more about my experiments here.

'EXODUS' GAME LEVEL EDITOR

As part of my project  Burnt Onion Studio at Carnegie Mellon ETC, I worked on a level editor in Unity.

The game uses a hexagon grid​. The game designer can create maps by editing elevation, terrain textures, add water bodies and assign resource management data to the cells on the grid realized using a procedurally generated mesh. The editor is based on hex map tutorials by Catlike Coding. I worked on the editor with the gameplay programmer. I was in charge of the visual components of the map, including bringing in assets created by the game artists.

[above ] Some initial tests for applying textures and finding the shortest path on the grid.

 
 
'EXODUS' GAME SHADERS

Some shader work for my project  Burnt Onion Studio at Carnegie Mellon ETC,.

The game allows the player to select the player to select the central character, a walking fortress, in God view and zoom right in. As they do so, the walls of the fortress closest to the camera begin to fade away smoothly. The player can use keys to rotate around the fortress and inspect the interiors and the characters working inside. Walls appear and disappear based on the viewing angle.

[above] A test with multiple buildable modules attached.

[above] One of the earlier tests.

The game employs a Fog of War, commonly used in real-time strategy games. The fog is uncovered based on the central character's movement. All environmental shaders in the game accommodate for this obscurement based on distance from the character.

MAYA SKINNING TOOL (PYTHON)

For my Technical Animation (CMU 15-664) final project, I implemented the paper ‘Real-time Skeletal Skinning with Optimized Centers of Rotation’ by Binh Huy Le (University of Houston) and Jessica K. Hodgins (Carnegie Mellon University) and published by Disney research (ACM SIGGRAPH 2016).

The aim of this project is to explore latest research in the area of skinning that seeks to avoid some common artifacts such as collapsing elbows, candy wrapper twists, and bulging around the joints of popular skinning techniques, such as linear blend skinning (LBS) and dual quaternion skinning (DQS), in order to achieve believable real-time deformations.

[above] The images on the left show the problem of collapsing seen with default Maya skinning where the arm bends. The images on the right are from my implementation, which corrects the collapsing problem.

[above] (From the paper): “We reorthogonalize the transformation by finding the best rigid transformation [Rp tp] to match a set of vertices {v} (red lines) with similar skinning weights with p from the rest pose to the LBS-deformed pose. Applying [Rp tp] to p generates the final result that removes the collapsing artifact (right).”

[above] The 'centers of rotation' in rest pose and final pose respectively.

[above] The solution handles the Candy Wrapper Effect too.

[above] Side-by-side comparison. The images on the left show the candy wrapper artifact seen with default Maya skinning where the arm bends. The images on the right are from my implementation, which fixes the problem.

[above] The 'centers of rotation' in rest pose and final pose respectively.